MCPcopy Create free account
hub / github.com/diillson/chatcli / handleChannelCommand

Method handleChannelCommand

cli/channel_command.go:33–71  ·  view source on GitHub ↗
(ctx context.Context, userInput string)

Source from the content-addressed store, hash-verified

31)
32
33func (cli *ChatCLI) handleChannelCommand(ctx context.Context, userInput string) {
34 if cli.mcpManager == nil {
35 fmt.Println()
36 fmt.Println(uiBox("📡", i18n.T("chan.cmd.box_title"), ColorPurple))
37 p := uiPrefix(ColorPurple)
38 fmt.Println(p + colorize(i18n.T("chan.cmd.mcp_disabled"), ColorYellow))
39 fmt.Println(uiBoxEnd(ColorPurple))
40 fmt.Println()
41 return
42 }
43
44 ch := cli.mcpManager.Channels()
45 args := strings.Fields(userInput)
46 subcommand := ""
47 if len(args) > 1 {
48 subcommand = args[1]
49 }
50
51 switch subcommand {
52 case "inject":
53 cli.runChannelInject(ch)
54 case "ack":
55 cli.runChannelAck()
56 case "pause":
57 cli.channelTriggerPause()
58 fmt.Println(colorize(" "+i18n.T("chan.cmd.pause_done"), ColorYellow))
59 case "resume":
60 cli.channelTriggerResume()
61 fmt.Println(colorize(" "+i18n.T("chan.cmd.resume_done"), ColorGreen))
62 case "rules":
63 cli.runChannelRules(args)
64 case "confirm":
65 cli.runChannelConfirm(ctx, args)
66 case "run":
67 cli.runChannelRun(ctx, args)
68 default:
69 cli.runChannelList(ch, subcommand)
70 }
71}
72
73// runChannelInject preserves the legacy /channel inject behavior.
74func (cli *ChatCLI) runChannelInject(ch interface {

Callers 1

buildRoutesMethod · 0.80

Calls 14

runChannelInjectMethod · 0.95
runChannelAckMethod · 0.95
channelTriggerPauseMethod · 0.95
channelTriggerResumeMethod · 0.95
runChannelRulesMethod · 0.95
runChannelConfirmMethod · 0.95
runChannelRunMethod · 0.95
runChannelListMethod · 0.95
TFunction · 0.92
uiBoxFunction · 0.85
uiPrefixFunction · 0.85
colorizeFunction · 0.85

Tested by

no test coverage detected