feat(cli): add Pi agent (pi-mcp-adapter) install support#663
Open
zh-xl-kang wants to merge 4 commits into
Open
feat(cli): add Pi agent (pi-mcp-adapter) install support#663zh-xl-kang wants to merge 4 commits into
zh-xl-kang wants to merge 4 commits into
Conversation
Add a `pi` field to cbm_detected_agents_t and detect the Pi agent (pi-mcp-adapter) by the presence of its ~/.pi/agent/ config directory, mirroring the existing Kiro/Cursor detection. List it in the "Detected agents" output. Signed-off-by: kangxl <230263957+zh-xl-kang@users.noreply.github.com>
Wire the Pi agent into the editor-style install and uninstall flows, mirroring Kiro/Cursor: write the codebase-memory-mcp entry to ~/.pi/agent/mcp.json (standard mcpServers format) via cbm_install_editor_mcp, and remove it on uninstall. Pi reads no instruction file, so none is written. Pi is also included in the install plan JSON. Signed-off-by: kangxl <230263957+zh-xl-kang@users.noreply.github.com>
Add cli_detect_agents_finds_pi (mirroring finds_kiro) and assert Pi is not detected in cli_detect_agents_none_found. The new test also covers Pi's nested-path detection: ~/.pi alone must not trigger, only ~/.pi/agent/ does. Register the test in the cli suite. Signed-off-by: kangxl <230263957+zh-xl-kang@users.noreply.github.com>
Add the Pi agent to the supported-agents lists and bump the agent count from 11 to 12 across README, the docs site, llms.txt, and the npm package README. Add a Pi row to the README agent config table (~/.pi/agent/mcp.json; no instruction file or hooks). Signed-off-by: kangxl <230263957+zh-xl-kang@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Add install/uninstall support for Pi agent (pi-mcp-adapter) to the CLI.
Relates to #649
Motivation
Pi agent (https://github.com/nicobailon/pi-mcp-adapter) is a coding agent that uses the standard mcpServers format in
~/.pi/agent/mcp.json. This PR adds detection, install, and uninstall support following the same pattern as Kiro/Cursor.Changes
Detection (
src/cli/cli.c,src/cli/cli.h)pifield tocbm_detected_agents_tstruct~/.pi/agent/directory existenceInstall/Uninstall (
src/cli/cli.c)cbm_install_editor_mcp()directly — no wrapper function needed~/.pi/agent/mcp.json(standard mcpServers format)cbm_remove_editor_mcp()Tests (
tests/test_cli.c)cli_detect_agents_finds_pi: verifies detection requires~/.pi/agent/(not just~/.pi/)ASSERT_FALSE(agents.pi)tocli_detect_agents_none_foundDocumentation
Design Decisions
Follow Kiro/Cursor pattern: Pi is placed in the editor agent group (not CLI agent group) because it uses the same
cbm_install_editor_mcp()function directly, matching the established convention for agents that only need MCP config without instruction files.No wrapper functions: Unlike Antigravity which has
cbm_upsert_antigravity_mcp(), Pi usescbm_install_editor_mcp()directly. This matches Kiro/Cursor and avoids unnecessary duplication.No AGENTS.md: Per pi-mcp-adapter documentation, the adapter only reads MCP server configuration from JSON files and does not process instruction files. Verified by reviewing the adapter source.
Detection specificity: Detection checks for
~/.pi/agent/(not just~/.pi/) to avoid false positives, as tested incli_detect_agents_finds_pi.Testing
cli_detect_agents_finds_pi✓cli_detect_agents_none_found✓-WerrorFiles Changed
src/cli/cli.h(+1 line)src/cli/cli.c(+17 lines)tests/test_cli.c(+24 lines)README.md(agent count + config table)docs/index.html(3 locations)docs/llms.txtpkg/npm/README.mdTotal: +54 / -11 across 7 files