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

Method gatewayStatus

cli/gateway_command.go:76–100  ·  view source on GitHub ↗

gatewayStatus reports the running daemon (if any) and which platforms are registered/configured.

()

Source from the content-addressed store, hash-verified

74// gatewayStatus reports the running daemon (if any) and which platforms are
75// registered/configured.
76func (cli *ChatCLI) gatewayStatus() {
77 names := gateway.RegisteredNames()
78 adapters, _ := gateway.BuildConfigured()
79 if pid, ok := gatewayRunningPID(); ok {
80 fmt.Printf(" %s %s\n", colorize("OK", ColorGreen), i18n.T("gateway.status_running", pid))
81 } else {
82 fmt.Printf(" %s %s\n", colorize("--", ColorGray), i18n.T("gateway.status_stopped"))
83 }
84 fmt.Printf(" %s %s\n", colorize(i18n.T("gateway.registered"), ColorYellow), strings.Join(names, ", "))
85 fmt.Printf(" %s %d\n", colorize(i18n.T("gateway.configured"), ColorYellow), len(adapters))
86
87 // Voice capability probe: same env the daemon reads, quiet logger so the
88 // REPL doesn't see provider-selection chatter.
89 probe := transcription.NewFromEnv(zap.NewNop())
90 if transcription.IsNull(probe) {
91 fmt.Printf(" %s %s\n", colorize(i18n.T("gateway.status_voice"), ColorYellow), i18n.T("gateway.status_voice_off"))
92 return
93 }
94 fmt.Printf(" %s %s\n", colorize(i18n.T("gateway.status_voice"), ColorYellow), probe.Name())
95 if pf := transcription.PreflightVoice(probe); len(pf.NeedsFFmpegFormats) > 0 {
96 fmt.Printf(" %s\n", colorize(
97 i18n.T("gateway.status_voice_warn", strings.Join(pf.NeedsFFmpegFormats, ", "), transcription.FFmpegInstallHint()),
98 ColorYellow))
99 }
100}
101
102// gatewayStartDetached re-execs `chatcli gateway` as a detached background
103// process so the interactive REPL stays free, tracking it via a pidfile.

Callers 3

handleGatewayCommandMethod · 0.95
TestGatewayStopRunningFunction · 0.95

Calls 10

RegisteredNamesFunction · 0.92
BuildConfiguredFunction · 0.92
TFunction · 0.92
NewFromEnvFunction · 0.92
IsNullFunction · 0.92
PreflightVoiceFunction · 0.92
FFmpegInstallHintFunction · 0.92
gatewayRunningPIDFunction · 0.85
colorizeFunction · 0.85
NameMethod · 0.65

Tested by 2

TestGatewayStopRunningFunction · 0.76