cat / 012
clone

a spreadsheet for the terminal: lotus 1-2-3 looks, google sheets keys and formulas, one go binary

install-mcp: hosts named after the apps: claude-code, claude-desktop, codex

Dami committed 1ef0029
commit
1ef0029b42fe1663a6fa39411d58b438dd208788
parent
d555e092b5bb8d6ca724a615fa95b6686fde9679
author
Dami <dami.etoile@gmail.com>
kind
chore risk score 2.0 of 3, Jev's estimate
3 files changed, +13 -13
Mcmd/012/agentskill.go2+-
Mcmd/012/installmcp.go14+++++++-------
Mcmd/012/installmcp_test.go10+++++-----
M cmd/012/agentskill.go +1 -1
M cmd/012/installmcp.go +7 -7
@@ -14,10 +14,10 @@ import (
1414 "time"1515 )1616 17-// 012 agent --install-mcp claude|codex|desktop: the entry that starts18-// 012 mcp, written into the host's configuration (see19-// docs/agents/mcp.md#adding-it-to-a-host). The entry runs this binary20-// by its absolute path with no workbook, so one server works on every17+// 012 agent --install-mcp claude-code|claude-desktop|codex: the entry18+// that starts 012 mcp, written into the host's configuration (see19+// docs/agents/mcp.md#adding-it-to-a-host). The entry runs this binary by20+// its absolute path with no workbook, so one server works on every2121 // workbook the host's roots or --root open to it. A file edited is2222 // copied beside itself first; an entry already the same is left alone.2323
@@ -34,9 +34,9 @@ type mcpHost struct {
3434 }3535 3636 var mcpHosts = []mcpHost{37- {name: "claude", app: "Claude Code", path: claudeConfig, entry: jsonEntry(true), show: jsonShow(true)},37+ {name: "claude-code", app: "Claude Code", path: claudeConfig, entry: jsonEntry(true), show: jsonShow(true)},3838 {name: "codex", app: "Codex", path: codexConfig, entry: tomlEntry, show: tomlShow},39- {name: "desktop", app: "Claude Desktop", path: desktopConfig, entry: jsonEntry(false), show: jsonShow(false)},39+ {name: "claude-desktop", app: "Claude Desktop", path: desktopConfig, entry: jsonEntry(false), show: jsonShow(false)},4040 }4141 4242 // executable is this binary's path; tests replace it.
@@ -51,7 +51,7 @@ func installMCP(e env, host string, roots []string, print bool) error {
5151 }5252 }5353 if h == nil {54- return usageError(fmt.Sprintf("--install-mcp takes claude, codex or desktop, not %q", host), agentUsage)54+ return usageError(fmt.Sprintf("--install-mcp takes claude-code, claude-desktop or codex, not %q", host), agentUsage)5555 }5656 command, err := executable()5757 if err != nil {
M cmd/012/installmcp_test.go +5 -5
@@ -32,7 +32,7 @@ func TestInstallMCPClaude(t *testing.T) {
3232 e, out, _ := scriptEnv(t)3333 path := filepath.Join(home, ".claude.json")3434 os.WriteFile(path, []byte(`{"numStartups": 3, "mcpServers": {"other": {"command": "x"}}, "projects": {"/p": {"allowedTools": []}}}`), 0o600)35- if code, err := status(e, "agent", "--install-mcp", "claude"); code != 0 {35+ if code, err := status(e, "agent", "--install-mcp", "claude-code"); code != 0 {3636 t.Fatal(err)3737 }3838 var got struct {
@@ -52,7 +52,7 @@ func TestInstallMCPClaude(t *testing.T) {
5252 t.Errorf("backups %d, said %q", backups(t, path), out)5353 }5454 out.Reset()55- if status(e, "agent", "--install-mcp", "claude"); !strings.Contains(out.String(), "is up to date") || backups(t, path) != 1 {55+ if status(e, "agent", "--install-mcp", "claude-code"); !strings.Contains(out.String(), "is up to date") || backups(t, path) != 1 {5656 t.Errorf("again: %q, %d backups", out, backups(t, path))5757 }5858 }
@@ -108,13 +108,13 @@ func TestInstallMCPDesktopAndPrint(t *testing.T) {
108108 if err != nil {109109 t.Fatal(err)110110 }111- if code, err := status(e, "agent", "--install-mcp", "desktop", "--print"); code != 0 || !strings.Contains(out.String(), `"command": "/opt/012/bin/012"`) {111+ if code, err := status(e, "agent", "--install-mcp", "claude-desktop", "--print"); code != 0 || !strings.Contains(out.String(), `"command": "/opt/012/bin/012"`) {112112 t.Fatalf("--print: %v %q", err, out)113113 }114114 if _, err := os.Stat(path); err == nil {115115 t.Error("--print wrote the file")116116 }117- if code, err := status(e, "agent", "--install-mcp", "desktop"); code != 0 {117+ if code, err := status(e, "agent", "--install-mcp", "claude-desktop"); code != 0 {118118 t.Fatal(err)119119 }120120 data, _ := os.ReadFile(path)
@@ -126,7 +126,7 @@ func TestInstallMCPDesktopAndPrint(t *testing.T) {
126126 if status(e, "agent", "--install-mcp", "codex", "--print"); !strings.Contains(out.String(), "[mcp_servers.012]\ncommand = \"/opt/012/bin/012\"\nargs = [\"mcp\"]\n") {127127 t.Errorf("codex --print: %q", out)128128 }129- for _, args := range [][]string{{"--install-mcp", "vscode"}, {"--install-mcp", "codex", "--skill"}, {"--print"}} {129+ for _, args := range [][]string{{"--install-mcp", "vscode"}, {"--install-mcp", "claude"}, {"--install-mcp", "desktop"}, {"--install-mcp", "codex", "--skill"}, {"--print"}} {130130 if code, _ := status(e, append([]string{"agent"}, args...)...); code != 2 {131131 t.Errorf("%v: status %d", args, code)132132 }