Skip to content

feat(installer): add Kiro target#297

Open
dohkimOnAmz wants to merge 1 commit into
colbymchenry:mainfrom
dohkimOnAmz:feat/installer-kiro
Open

feat(installer): add Kiro target#297
dohkimOnAmz wants to merge 1 commit into
colbymchenry:mainfrom
dohkimOnAmz:feat/installer-kiro

Conversation

@dohkimOnAmz
Copy link
Copy Markdown

Summary

Add Kiro (kiro.dev) as a codegraph install target so Kiro users get the same auto-detect / install / uninstall flow that Claude Code, Cursor, Codex CLI, opencode, and Hermes Agent already get. The CodeGraph runtime is already agent-agnostic — this is purely an installer-layer addition.

After install, codegraph appears in Kiro under mcpServers.codegraph at:

  • ~/.kiro/settings/mcp.json (user-global — --location=global)
  • ./.kiro/settings/mcp.json (workspace — --location=local)

Both are documented Kiro paths and Kiro merges them with workspace precedence (https://kiro.dev/docs/mcp/configuration/). Kiro auto-reconnects on file save, so no IDE restart is needed after install — no notes are emitted.

Implementation

Mirrors the Cursor target with two simplifications:

  • No --path injection. Cursor needed it because its MCP launch cwd isn't the workspace; Kiro launches with the workspace as cwd, so the standard process.cwd() resolution finds .codegraph/ correctly.
  • No project-local rules / instructions surface. Steering files (.kiro/steering/*.md) are deliberately out of scope for this PR — Hermes also ships no instructions surface, and adding one can be a follow-up via wireProjectSurfaces() if it proves valuable.

KiroTarget reuses existing helpers from targets/shared.ts only — getMcpServerConfig, readJsonFile, writeJsonFile, jsonDeepEqual. No new shared utilities, no new dependencies.

Files changed

  • src/installer/targets/kiro.ts — new (~115 LOC)
  • src/installer/targets/types.ts — add 'kiro' to TargetId
  • src/installer/targets/registry.ts — import + append kiroTarget to ALL_TARGETS
  • src/bin/codegraph.ts — add "Kiro" to the install command description
  • __tests__/installer-targets.test.ts — Kiro-specific tests + getTarget('kiro') line in the registry test
  • README.md — add Kiro to badges, supported-agents list, and the restart note

Test plan

  • npm run build — clean
  • npx vitest run __tests__/installer-targets.test.ts86 tests passing, including the parameterized contract suite which automatically covers Kiro × {global, local}: install writes files, idempotent re-run is byte-identical, sibling MCP servers in the same JSON survive, uninstall reverses install,
    printConfig doesn't touch disk.
  • Two Kiro-specific tests added:
    • Writes to .kiro/settings/mcp.json (nested), not .kiro/mcp.json — guards against an accidental refactor of the path layout.
    • Full install / uninstall round-trip preserves a sibling mcpServers.someOther.
  • Manual CLI smoke test in a tmpdir:
    • codegraph install --target=kiro --location=local --yesCreated /tmp/.../.kiro/settings/mcp.json with the expected JSON.
    • Re-running the same command → Unchanged.
    • With a hand-seeded sibling MCP server, install preserves the sibling and adds codegraph.
  • codegraph install --print-config kiro prints the snippet for both global and local paths without touching disk.

Notes for the maintainer

I did not include a version bump / CHANGELOG entry / link footer in this PR — those felt like release-time territory. Happy to add a ### Unreleased–style line if that's the preference. Suggested CHANGELOG copy if useful:

Installer target: Kiro (kiro.dev). codegraph install now supports Kiro — it writes mcpServers.codegraph to .kiro/settings/mcp.json (workspace) or ~/.kiro/settings/mcp.json (user-global), so Kiro can drive the CodeGraph knowledge graph like the other agents. Kiro auto-reconnects on file save, so no IDE
restart is needed.

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