gatewayStatus reports the running daemon (if any) and which platforms are registered/configured.
()
| 74 | // gatewayStatus reports the running daemon (if any) and which platforms are |
| 75 | // registered/configured. |
| 76 | func (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. |