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

Method routeConfigCommand

cli/config_sections.go:55–130  ·  view source on GitHub ↗

─── Routing ─────────────────────────────────────────────────── routeConfigCommand dispatches /config [section]. Args comes without the leading "/config" token.

(ctx context.Context, args []string)

Source from the content-addressed store, hash-verified

53// routeConfigCommand dispatches /config [section]. Args comes without the
54// leading "/config" token.
55func (cli *ChatCLI) routeConfigCommand(ctx context.Context, args []string) {
56 if len(args) == 0 {
57 cli.showConfigPanorama()
58 return
59 }
60 section := strings.ToLower(args[0])
61 // Sections that follow the uniform "bare shows the panorama, arguments
62 // mutate" shape are dispatched from a table so this function stays flat.
63 // Sections needing the context (image/hub/scheduler) or a special alias
64 // (ui/theme) keep their explicit cases below.
65 if cli.routeHierarchicalConfig(section, args[1:]) {
66 return
67 }
68 switch section {
69 case "all", "full":
70 cli.showConfigAll(ctx)
71 case "general":
72 cli.showConfigGeneral()
73 case "providers", "provider":
74 cli.showConfigProviders()
75 case "ui":
76 // Hierarchical like security/hub: bare form shows the theme +
77 // color-profile panorama; `ui theme <name>` switches at runtime.
78 if len(args) == 1 {
79 cli.printConfigUIStatus()
80 } else {
81 cli.routeConfigUI(args[1:])
82 }
83 case "theme":
84 // Convenience alias so `/config theme dark` == `/config ui theme dark`.
85 // args already starts with "theme", which routeConfigUI reads as its
86 // subcommand, so pass it through unstripped.
87 cli.routeConfigUI(args)
88 case "resilience", "proxy":
89 cli.showConfigResilience()
90 case "session":
91 cli.showConfigSession()
92 case "integrations", "integration":
93 cli.showConfigIntegrations(ctx)
94 case "auth":
95 cli.showConfigAuth()
96 case "image", "img":
97 // Hierarchical: bare form shows the @image panorama; provider/api/
98 // model/url/models/reset mutate the backend at runtime.
99 if len(args) == 1 {
100 cli.showConfigImage(ctx)
101 } else {
102 cli.routeConfigImage(ctx, args[1:])
103 }
104 case "diagram", "diagrams":
105 cli.showConfigDiagram(ctx)
106 case "graphview", "graph":
107 cli.showConfigGraphView()
108 case "quality":
109 cli.showConfigQuality()
110 case "memory", "mem":
111 cli.showConfigMemory()
112 case "selfevolve", "evolve", "self-evolution":

Callers 2

TestRouteConfigCommandFunction · 0.80
cmdConfigMethod · 0.80

Calls 15

showConfigPanoramaMethod · 0.95
showConfigAllMethod · 0.95
showConfigGeneralMethod · 0.95
showConfigProvidersMethod · 0.95
printConfigUIStatusMethod · 0.95
routeConfigUIMethod · 0.95
showConfigResilienceMethod · 0.95
showConfigSessionMethod · 0.95
showConfigAuthMethod · 0.95
showConfigImageMethod · 0.95

Tested by 1

TestRouteConfigCommandFunction · 0.64