Skip to content

feat(installer): add GitHub Copilot CLI target#586

Open
lazyayuan wants to merge 1 commit into
colbymchenry:mainfrom
lazyayuan:feat/copilot-cli-installer
Open

feat(installer): add GitHub Copilot CLI target#586
lazyayuan wants to merge 1 commit into
colbymchenry:mainfrom
lazyayuan:feat/copilot-cli-installer

Conversation

@lazyayuan
Copy link
Copy Markdown

Summary

Add GitHub Copilot CLI as a supported installer target. codegraph install --target=copilot now configures the Copilot CLI agent, writing MCP server entries to ~/.copilot/mcp-config.json (global) or ./.mcp.json (local/workspace).

Changes

  • New target: src/installer/targets/copilot.ts — install/uninstall/detect/printConfig for Copilot CLI, using mcpServers JSON format (same shape as Claude Code, Cursor, Kiro).
  • Shared-config cascade: uninstallTargets now detects when multiple targets share the same config file (e.g. .mcp.json is used by both Claude Code and Copilot CLI for local installs). When one target removes the codegraph entry, subsequent targets that also write to that file are reported as cascade-removed with a warning — instead of silently double-deleting.
  • Claude local detection fix: Claude's detect() no longer uses .mcp.json existence as a local-installed signal (since it's shared infrastructure). Only .claude/ directory is used. This prevents false positives when only Copilot local is installed.
  • Copilot local detection: uses ~/.copilot directory (not .mcp.json) to detect whether Copilot CLI is installed locally, avoiding false positives when only Claude/Cursor local is set up.

Tests

__tests__/installer-targets.test.ts — 6 new cases:

  • Local install writes ./.mcp.json with mcpServers key
  • Global install writes to ~/.copilot/mcp-config.json
  • Install preserves a pre-existing sibling MCP server in .mcp.json
  • Uninstall strips codegraph but leaves sibling MCP servers intact
  • printConfig returns mcpServers format
  • Registry lookup returns copilot target

Full suite green (152/152).

Notes

  • README badges + supported agents list updated.
  • CHANGELOG entry added under [Unreleased].
  • CLI install/uninstall descriptions updated to include Copilot CLI.

- New target: copilot.ts — writes MCP server entries to
  ~/.copilot/mcp-config.json (global) or ./.mcp.json (local)
- Shared-config cascade: uninstallTargets detects when multiple
  targets share .mcp.json and skips redundant removal + warns
- Claude local detection no longer uses .mcp.json as a signal
  (shared with Copilot) — only .claude/ directory
- Copilot local detection uses ~/.copilot dir, not .mcp.json,
  to avoid false positives when only Claude/Cursor local is set up
- Tests: 6 new cases covering install, sibling preservation,
  uninstall, printConfig, and registry lookup
- README/CHANGELOG/CLI descriptions updated
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