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

Method executeRemoteCommand

server/handler_session.go:301–324  ·  view source on GitHub ↗

executeRemoteCommand parses and executes a server-side command, returning the result string.

(rawCommand string)

Source from the content-addressed store, hash-verified

299
300// executeRemoteCommand parses and executes a server-side command, returning the result string.
301func (h *Handler) executeRemoteCommand(rawCommand string) string {
302 cmd := strings.TrimSpace(rawCommand)
303 if cmd == "" {
304 return i18n.T("server.session.cmd_empty")
305 }
306
307 // Normalize: remove leading '/' if present
308 cmd = strings.TrimPrefix(cmd, "/")
309
310 switch {
311 case cmd == "status":
312 return h.cmdStatus()
313 case cmd == "watcher status":
314 return h.cmdWatcherStatus()
315 case cmd == "plugins list":
316 return h.cmdPluginsList()
317 case cmd == "agents list":
318 return h.cmdAgentsList()
319 case cmd == "skills list":
320 return h.cmdSkillsList()
321 default:
322 return i18n.T("server.session.cmd_unknown", rawCommand)
323 }
324}
325
326func (h *Handler) cmdStatus() string {
327 vi := version.GetCurrentVersion()

Callers 1

InteractiveSessionMethod · 0.95

Calls 6

cmdStatusMethod · 0.95
cmdWatcherStatusMethod · 0.95
cmdPluginsListMethod · 0.95
cmdAgentsListMethod · 0.95
cmdSkillsListMethod · 0.95
TFunction · 0.92

Tested by

no test coverage detected