Skip to content

feat(install): detect and configure pi coding agent#534

Open
Tensorboyalive wants to merge 2 commits into
DeusData:mainfrom
Tensorboyalive:feat/pi-adapter
Open

feat(install): detect and configure pi coding agent#534
Tensorboyalive wants to merge 2 commits into
DeusData:mainfrom
Tensorboyalive:feat/pi-adapter

Conversation

@Tensorboyalive

Copy link
Copy Markdown

Add pi (@earendil-works/pi-coding-agent) to the installer

install/uninstall auto-detect and configure 11 agents today, but not
pi. This adds pi as a
first-class target.

Why pi is wired differently (no mcpServers entry)

pi has no native MCP. Its README states: "No MCP. Build CLI tools with
READMEs (Skills), or build an extension that adds MCP support."
So instead of an
MCP server entry, the pi adapter installs the three things pi actually consumes,
all driven by the existing CLI mode (codebase-memory-mcp cli <tool> '<json>'):

  1. a pi extension~/.pi/agent/extensions/cbmem.ts — registers
    cbm_search_graph, cbm_trace_path, cbm_get_architecture,
    cbm_semantic_query, cbm_detect_changes, cbm_query_graph, cbm_index,
    cbm_list_projects as native pi tools that shell out to the binary;
  2. the codebase-memory skill~/.config/agents/skills/codebase-memory/;
  3. an AGENTS.md graph-first reminder, via the existing
    cbm_upsert_instructions sentinel upsert.

Changes

  • cbm_detected_agents_t gains bool pi; cbm_detect_agents sets it.
  • cbm_pi_config_dir honors $PI_CODING_AGENT_DIR, falls back to ~/.pi/agent
    (mirrors how cbm_claude_config_dir honors $CLAUDE_CONFIG_DIR).
  • install_pi_config / uninstall_pi: write/remove the extension + skill +
    AGENTS.md block; respect --force and --dry-run; recorded in install --plan.
  • README Multi-Agent Support table gains a pi row.
  • Tests (tests/test_cli.c): detection (incl. $PI_CODING_AGENT_DIR),
    install writes extension/skill/AGENTS, uninstall reverses it.

Validation

  • Clean build (-Wall -Wextra -Werror).
  • install --planinstalluninstall lifecycle verified against a fake
    HOME: extension/skill/AGENTS written then fully removed (sentinel gone).
  • Memory handling matches the existing Codex/OpenCode upsert patterns
    (malloc/read_file_str/write_file_str, freed on every path).

No existing agent behavior is changed; this is purely additive.

pi has no native MCP, so wire it up via the binary's CLI mode: install a pi
extension (cbmem.ts, registers cbm_* tools), the codebase-memory skill, and an
AGENTS.md graph-first reminder. Honors $PI_CODING_AGENT_DIR; falls back to
~/.pi/agent. Adds detection, install/uninstall, install-plan entries, and tests.

Co-authored-by: builder-pi-adapter (gpt-5.5 via Overstory)
Session-Id: 019ee430-dc1a-7575-a0ed-f2f2cf2f1379
Signed-off-by: Manav Gupta <manav.tensorboy@gmail.com>
Session-Id: 019ee430-dc1a-7575-a0ed-f2f2cf2f1379
The pi skill frontmatter description was unquoted but contained ': ' and inner
double-quotes, which YAML parses as a nested mapping -> pi's skill loader
rejected it. Wrap the value in double quotes and use single quotes for the
inline trigger examples, matching how the other skills quote descriptions.

Signed-off-by: Manav Gupta <manav.tensorboy@gmail.com>
Session-Id: 019ee430-dc1a-7575-a0ed-f2f2cf2f1379
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