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

Method DescribeCall

cli/plugins/builtin_coder_caps.go:41–76  ·  view source on GitHub ↗

DescribeCall surfaces what @coder is about to do: which subcommand, against which target. Strings are i18n-resolved at call time.

(args []string)

Source from the content-addressed store, hash-verified

39// DescribeCall surfaces what @coder is about to do: which subcommand,
40// against which target. Strings are i18n-resolved at call time.
41func (p *BuiltinCoderPlugin) DescribeCall(args []string) string {
42 sub := coderSubcommand(args)
43 switch sub {
44 case "read":
45 if f := extractPathArg(args); f != "" {
46 return i18n.T("plugins.coder.describe.read", f)
47 }
48 case "search":
49 if t := extractStringArg(args, "term", "pattern", "query"); t != "" {
50 return i18n.T("plugins.coder.describe.search", t)
51 }
52 case "exec":
53 if c := extractNestedArg(args, "cmd", "command"); c != "" {
54 if len(c) > 60 {
55 c = c[:60] + "..."
56 }
57 return i18n.T("plugins.coder.describe.exec", c)
58 }
59 case "write":
60 if f := extractPathArg(args); f != "" {
61 return i18n.T("plugins.coder.describe.write", f)
62 }
63 case "patch":
64 if f := extractPathArg(args); f != "" {
65 return i18n.T("plugins.coder.describe.patch", f)
66 }
67 case "tree":
68 if d := extractStringArg(args, "dir", "path"); d != "" {
69 return i18n.T("plugins.coder.describe.tree", d)
70 }
71 }
72 if sub != "" {
73 return i18n.T("plugins.coder.describe.generic", sub)
74 }
75 return p.Description()
76}
77
78// coderSubcommand extracts the @coder subcommand from the first arg,
79// handling both the JSON envelope ({"cmd":"read","args":{…}}) and the

Calls 6

DescriptionMethod · 0.95
TFunction · 0.92
coderSubcommandFunction · 0.85
extractPathArgFunction · 0.85
extractStringArgFunction · 0.85
extractNestedArgFunction · 0.85