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

Function coderSubcommand

cli/plugins/builtin_coder_caps.go:81–92  ·  view source on GitHub ↗

coderSubcommand extracts the @coder subcommand from the first arg, handling both the JSON envelope ({"cmd":"read","args":{…}}) and the positional form (`read --file foo`).

(args []string)

Source from the content-addressed store, hash-verified

79// handling both the JSON envelope ({"cmd":"read","args":{…}}) and the
80// positional form (`read --file foo`).
81func coderSubcommand(args []string) string {
82 if len(args) == 0 {
83 return ""
84 }
85 first := strings.TrimSpace(args[0])
86 if strings.HasPrefix(first, "{") {
87 if v := extractStringArg([]string{first}, "cmd", "command"); v != "" {
88 return v
89 }
90 }
91 return first
92}

Callers 2

IsReadOnlyMethod · 0.85
DescribeCallMethod · 0.85

Calls 1

extractStringArgFunction · 0.85

Tested by

no test coverage detected