feat(setup): add CommandCode CLI as supported agent - #1123
Conversation
Register CommandCode as a declarative agent so `engram setup commandcode` wires the MCP server and the Memory Protocol without a manual config edit. Writes mcpServers.engram to the user-scope ~/.commandcode/mcp.json using the {transport:stdio, enabled, command, args} shape verified against real `cmd mcp add --scope user` output, and the protocol as a marker block in the user-tier ~/.commandcode/AGENTS.md. Closes Gentleman-Programming#1119
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Repository UI Review profile: ASSERTIVE Plan: Advanced Run ID: 📒 Files selected for processing (7)
Included review availability: Your plan provides up to 8 included reviews per hour; 7 remain after this review. 📝 WalkthroughWalkthroughThe setup registry now supports CommandCode through ChangesCommandCode setup support
Estimated code review effort: 2 (Simple) | ~10 minutes Severity of issue fixed: Medium Suggested reviewers: Sequence Diagram(s)sequenceDiagram
participant User
participant EngramSetup
participant CommandCodeMCP
participant CommandCodeMemory
User->>EngramSetup: Run engram setup commandcode
EngramSetup->>CommandCodeMCP: Write mcpServers.engram
EngramSetup->>CommandCodeMemory: Write Memory Protocol marker block
EngramSetup-->>User: Display verification and restart guidance
Merge Risk: ⚪ Minimal · up to No actionable merge-blocking risk remains in the CommandCode setup integration. 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
Full details: Docstring CoverageExplanation Docstring coverage is 33.33% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 12 functions across 5 files. (2 skipped: 2 unsupported.)
✨ Finishing Touches 💡 1🛠️ Fix failing CI checks 💡
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
🔗 Linked Issue
Closes #1119
🏷️ PR Type
type:bug— Bug fixtype:feature— New featuretype:docs— Documentation onlytype:refactor— Code refactoring (no behavior change)type:chore— Maintenance, dependencies, toolingtype:breaking-change— Breaking change📝 Summary
commandcodeas a declarative agent inagentAdapters()— no custom installer, the genericinjectMCP/writeInstructiondriver handles both writes.engram setup commandcoderegistersmcpServers.engramin the user-scope~/.commandcode/mcp.json(private, available across all projects).~/.commandcode/AGENTS.md, preserving user preferences and staying idempotent (CommandCode re-reads memory every request, so no restart needed forAGENTS.md).📂 Changes
internal/setup/registry.gocommandCodeObjectMCP format ({transport:"stdio", enabled:true, command, args}undermcpServers) +mcpEntrycaseinternal/setup/agents.gocommandcoderegistry entry pluscommandcodeDir/commandcodeMCPPath/commandcodeAgentsPathhelpersinternal/setup/registry_test.gocommandcoderow indeclarativeAgents(), in expectedSupportedAgents(), andtransport/enabledshape assertionscmd/engram/main.gocommandcodeadded to thesetup [agent]usage linecmd/engram/main_test.gocommandcodein usage list and aprintPostInstallcaseREADME.mdCommandCoderow in supported-agents tabledocs/AGENT-SETUP.mdCommandCodetable row,## CommandCodesection, format note in intro🧪 Test Plan
go test ./...go test -tags e2e ./internal/server/...make lintgo test ./...is NOT green: the only 2 failures (TestInstallPiInstallsPackagesAndWritesConfigininternal/setup,TestDetectProjectFull_ChildScanFindsLaterSecondRepositoryininternal/project) reproduce identically on a clean tree without this change (verified viagit stash -u), so they are pre-existing environment failures, not regressions. Deliberately left unchecked rather than marked PASS.Manual verification —
engram setup commandcodeagainst an isolatedHOME:{ "mcpServers": { "engram": { "command": "<absolute-path-to>/engram", "enabled": true, "transport": "stdio", "args": ["mcp", "--tools=agent"] } } }Re-running is idempotent (1 marker block). The real CLI accepts the generated file:
cmd mcp listshowsengram / stdio / user / enabledandcmd mcp get engramreports the correct transport, command and args.🤖 Automated Checks
These run automatically and all must pass before merge:
Closes #N/Fixes #N/Resolves #Nstatus:approvedlabeltype:*labelgo test ./...passesgo test -tags e2e ./internal/server/...passesnpm testpasses inplugin/pi✅ Contributor Checklist
Closes #1119)type:*label to this PRgo test ./...go test -tags e2e ./internal/server/...make lintCo-Authored-Bytrailers in commits💬 Notes for Reviewers
mcpFormatinstead of reusingmcpServersObject. The issue left the stdio shape as an open verification point; it was verified empirically with the real CLI (cmd mcp add --scope user engram-probe -- …→cmd mcp get, probe removed and the user config restored byte-identical afterwards): CommandCode writes{transport:"stdio", enabled:true, command, args}. A bare{command, args}entry would omit the transport discriminator, so a new format value was added following theserversObject/opencodeObjectprecedent.markerBlock, notwholeFile. Unlike Cline (dedicated rules dir),~/.commandcode/AGENTS.mdis a shared user-preferences file read cumulatively with project/subdirectory tiers — same reasoning as the qwen/kilocode adapters.skills/plugin-thin, exactly as scoped in feat(setup): add CommandCode CLI as supported agent #1119.docs/INSTALLATION.mduntouched, mirroring PR feat(setup): add Cline CLI as supported agent #1116 (6-file scope + the new-format hunk).Summary by CodeRabbit
New Features
Documentation
Tests