feat(installer): add codegraph uninstall command (#313) (#318)

Adds a cross-channel uninstall that removes CodeGraph from every agent it's
configured on (Claude Code, Cursor, Codex CLI, opencode, Hermes). Prompts
global-vs-local up front (no flags required) and reports which providers it
actually hit; --location / --target / --yes supported for non-interactive use.
Removes only what install wrote; leaves the .codegraph/ index to `uninit`.

Also fixes Cursor uninstall leaving an orphaned .cursor/rules/codegraph.mdc
(its description: CodeGraph frontmatter lingered); the dedicated rules file is
now deleted outright while user content outside our markers is preserved.

Validated end-to-end on macOS and Docker Linux (global + local sweeps clean).
Adds 8 tests; full suite 730 passing. Bumps to 0.9.3 with CHANGELOG entry.

Resolves #313.

Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
Colby Mchenry
2026-05-22 04:51:42 -05:00
committed by GitHub
co-authored by Claude Opus 4.7
parent 77e29c436c
commit bf73f4d05c
7 changed files with 435 additions and 8 deletions
+24
View File
@@ -7,6 +7,29 @@ a [GitHub Release](https://github.com/colbymchenry/codegraph/releases) tagged
This project follows [Keep a Changelog](https://keepachangelog.com/en/1.1.0/)
and adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
## [0.9.3] - 2026-05-22
### Added
- **`codegraph uninstall` command.** Cleanly removes CodeGraph from every agent
it's configured on — Claude Code, Cursor, Codex CLI, opencode, and Hermes
Agent — in one step. It asks up front whether to remove the global config
(`~/.claude`, `~/.codex`, …) or just this project's local config (no flags
required), then prints exactly which agents it touched so you can see what
changed. `--location`, `--target`, and `--yes` are accepted for scripted /
non-interactive use. It removes only what `install` wrote (MCP server entry,
instructions block, permissions) and leaves your `.codegraph/` index alone
(use `codegraph uninit` for that). Resolves
[#313](https://github.com/colbymchenry/codegraph/issues/313) — previously the
only cleanup path was an npm `preuninstall` hook that the published bundle
never shipped, so `npm uninstall -g` left every agent pointing at a CodeGraph
MCP server that no longer existed.
### Fixed
- **Cursor uninstall left an orphaned `.cursor/rules/codegraph.mdc`.** It
stripped the rule body but left the file and its `description: CodeGraph …`
frontmatter behind. The dedicated rules file is now deleted outright on
uninstall, while any content you added outside CodeGraph's markers is kept.
## [0.9.2] - 2026-05-21
### Added
@@ -93,6 +116,7 @@ and adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
find its bundle. The release pipeline now verifies every package reached the
registry (and is idempotent), so a release can't pass green-but-broken again.
[0.9.3]: https://github.com/colbymchenry/codegraph/releases/tag/v0.9.3
[0.9.2]: https://github.com/colbymchenry/codegraph/releases/tag/v0.9.2
[0.9.1]: https://github.com/colbymchenry/codegraph/releases/tag/v0.9.1