Skip to content

feat(cli): add Pi agent (pi-mcp-adapter) install support#663

Open
zh-xl-kang wants to merge 4 commits into
DeusData:mainfrom
zh-xl-kang:feat/add-pi-agent-support-v2
Open

feat(cli): add Pi agent (pi-mcp-adapter) install support#663
zh-xl-kang wants to merge 4 commits into
DeusData:mainfrom
zh-xl-kang:feat/add-pi-agent-support-v2

Conversation

@zh-xl-kang

Copy link
Copy Markdown

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)

  • Add pi field to cbm_detected_agents_t struct
  • Detect Pi agent by checking for ~/.pi/agent/ directory existence
  • Add "Pi" to the detected agents output list

Install/Uninstall (src/cli/cli.c)

  • Wire Pi into the editor-style install flow (alongside Kiro/Cursor/OpenClaw)
  • Use cbm_install_editor_mcp() directly — no wrapper function needed
  • Config path: ~/.pi/agent/mcp.json (standard mcpServers format)
  • No instruction file (AGENTS.md) — Pi adapter does not read instruction files per its documentation
  • Add uninstall support with cbm_remove_editor_mcp()
  • Include Pi in the install plan JSON

Tests (tests/test_cli.c)

  • Add cli_detect_agents_finds_pi: verifies detection requires ~/.pi/agent/ (not just ~/.pi/)
  • Add ASSERT_FALSE(agents.pi) to cli_detect_agents_none_found
  • All Pi-related tests pass

Documentation

  • Update README.md: "11 agents" → "12 agents", add Pi config row
  • Update docs/index.html (3 locations)
  • Update docs/llms.txt
  • Update pkg/npm/README.md

Design Decisions

  1. 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.

  2. No wrapper functions: Unlike Antigravity which has cbm_upsert_antigravity_mcp(), Pi uses cbm_install_editor_mcp() directly. This matches Kiro/Cursor and avoids unnecessary duplication.

  3. 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.

  4. Detection specificity: Detection checks for ~/.pi/agent/ (not just ~/.pi/) to avoid false positives, as tested in cli_detect_agents_finds_pi.

Testing

  • All Pi-related tests pass:
    • cli_detect_agents_finds_pi
    • cli_detect_agents_none_found
  • Code compiles cleanly with -Werror
  • All commits are signed off (DCO compliant)

Files 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.txt
  • pkg/npm/README.md

Total: +54 / -11 across 7 files

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>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant