Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions changes/scope-interactive-uninstall-guidance.fixed.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
"githits": patch
"@githits/mcp": none
---

- **Respect uninstall selection for guidance** - Interactive user uninstall now removes guidance only for selected tools whose MCP is absent after cleanup and preserves shared guidance usable by any detected tool that was kept.
4 changes: 2 additions & 2 deletions docs/implementation/cli-commands.md
Original file line number Diff line number Diff line change
Expand Up @@ -140,9 +140,9 @@ Global setup supports Claude Code, Cursor, Windsurf, VS Code / Copilot, Cline, C

The command uses `createContainer()` lazily for the login step. Tool detection and configuration use lightweight dependencies that don't require auth.

The top-level `githits uninstall` command reverses the tool configuration performed by init; `githits init uninstall` remains a compatibility alias with the same flags and behavior. In interactive mode it first asks whether to remove user-level config or project-level config. User-level uninstall scans the same supported agents, removes only GitHits MCP/plugin entries, and leaves authentication credentials untouched. Unless `--keep-guidance` is passed, it also removes all four canonical GitHits skill files and the exact historical Cline/Junie `githits-mcp/SKILL.md` files, while preserving unrelated skills and directories. Use `githits logout` separately to remove stored credentials. For Claude Code, user-level inspection reads `$CLAUDE_CONFIG_DIR/.claude.json` when `CLAUDE_CONFIG_DIR` is non-empty, otherwise `~/.claude.json`; it inspects only `mcpServers.githits`, skips an already-absent removal, and rereads the structure after mutation. Malformed or unreadable Claude state blocks MCP mutation. Config-file uninstall removes `GitHits`/case-variant server entries while preserving other MCP servers and user settings; MCP host-config cleanup preserves the host config files and directories. Project uninstall uses the verified project config paths above, removes only GitHits entries from project-local files, preserves unrelated servers/settings, and best-effort removes legacy `.githits/init/project-setup.json` markers from earlier versions. Project uninstall does not remove global tools or Pi's global `pi-mcp-adapter` package because they can be shared by other projects; legacy, pre-existing, and GitHits-installed global Pi adapters are left installed. User-level Pi uninstall removes the `GitHits` entry from Pi's MCP config and runs `pi remove npm:pi-mcp-adapter` when the Pi CLI is available; if Pi is no longer installed, stale Pi MCP config entries are still removable without attempting adapter cleanup. Project uninstall is best-effort across supported config paths: missing files and files without GitHits are skipped, malformed/read-only/write-failing files are reported in the final summary, and the command exits 1 only after all possible removals have been attempted. JSONC-style files are accepted on read and rewritten as canonical JSON only when changed, matching setup behavior. Codex project setup rewrites `.codex/config.toml` as TOML and does not preserve existing TOML comments or formatting.
The top-level `githits uninstall` command reverses the tool configuration performed by init; `githits init uninstall` remains a compatibility alias with the same flags and behavior. In interactive mode it first asks whether to remove user-level config or project-level config. User-level uninstall scans the same supported agents, removes only GitHits MCP/plugin entries, and leaves authentication credentials untouched. Unless `--keep-guidance` is passed, interactive user uninstall also removes the four canonical GitHits skill files and exact historical Cline/Junie `githits-mcp/SKILL.md` files owned by the selected tools. Guidance usable by an unselected detected tool is retained, including shared targets, and a selected tool retains its guidance when its MCP removal fails. Non-interactive `--yes` and user uninstall with no configured MCP target clean every verified user guidance target; project uninstall cleans every verified project guidance target. Unrelated skills and directories are preserved. Use `githits logout` separately to remove stored credentials. For Claude Code, user-level inspection reads `$CLAUDE_CONFIG_DIR/.claude.json` when `CLAUDE_CONFIG_DIR` is non-empty, otherwise `~/.claude.json`; it inspects only `mcpServers.githits`, skips an already-absent removal, and rereads the structure after mutation. Malformed or unreadable Claude state blocks MCP mutation. Config-file uninstall removes `GitHits`/case-variant server entries while preserving other MCP servers and user settings; MCP host-config cleanup preserves the host config files and directories. Project uninstall uses the verified project config paths above, removes only GitHits entries from project-local files, preserves unrelated servers/settings, and best-effort removes legacy `.githits/init/project-setup.json` markers from earlier versions. Project uninstall does not remove global tools or Pi's global `pi-mcp-adapter` package because they can be shared by other projects; legacy, pre-existing, and GitHits-installed global Pi adapters are left installed. User-level Pi uninstall removes the `GitHits` entry from Pi's MCP config and runs `pi remove npm:pi-mcp-adapter` when the Pi CLI is available; if Pi is no longer installed, stale Pi MCP config entries are still removable without attempting adapter cleanup. Project uninstall is best-effort across supported config paths: missing files and files without GitHits are skipped, malformed/read-only/write-failing files are reported in the final summary, and the command exits 1 only after all possible removals have been attempted. JSONC-style files are accepted on read and rewritten as canonical JSON only when changed, matching setup behavior. Codex project setup rewrites `.codex/config.toml` as TOML and does not preserve existing TOML comments or formatting.

Unless `--keep-guidance` is passed, global guidance cleanup attempts every verified skill and managed-block target independently. Already-absent targets are quiet, supported skill-directory symlinks remain in place after `SKILL.md` removal, and hard failures keep their target path while later targets continue. Guidance is rendered separately from MCP agents: changed or failed paths are shown, all-absent guidance collapses to one unchanged row, guidance affects the headline and exit status, and agent counts exclude it.
Guidance cleanup attempts each in-scope skill and managed-block target independently. Already-absent targets are quiet, supported skill-directory symlinks remain in place after `SKILL.md` removal, and hard failures keep their target path while later targets continue. Guidance is rendered separately from MCP agents: changed or failed paths are shown, protected targets collapse to one unchanged row stating how many targets tools may still use, all-absent guidance collapses to one unchanged row, guidance affects the headline and exit status, and agent counts exclude it.

For automation, `githits uninstall --yes` is user-level only and never touches project files. Use `githits uninstall --project --yes` for non-interactive project-level removal. The nested `githits init uninstall` form remains supported for compatibility.

Expand Down
17 changes: 11 additions & 6 deletions docs/implementation/init-guidance-and-expanded-agent-support.md
Original file line number Diff line number Diff line change
Expand Up @@ -106,12 +106,17 @@ After successful cleanup, another guided run is a no-op for that migration.

The canonical command is `githits uninstall`; `githits init uninstall` remains
a compatibility alias with identical `--yes`, `--project`, and
`--keep-guidance` behavior. Without `--keep-guidance`, uninstall independently
and best-effort removes all four active skill files and the exact historical
Cline/Junie files for the chosen scope, while preserving unrelated files and
directories. Removing a shared root can affect every compatible agent that
reads that directory; the result reports the shared guidance target. The
`--keep-guidance` option preserves active and historical guidance.
`--keep-guidance` behavior. Without `--keep-guidance`, interactive user
uninstall best-effort removes active and historical guidance only for selected
tools. It retains a shared skill or managed-block target when any unselected
detected tool could use it, and retains a selected tool's guidance when its MCP
removal fails. Non-interactive `--yes`, project uninstall, and user uninstall
with no configured MCP targets clean every verified guidance target in the
chosen scope. Cleanup removes all four active skill files and the exact
historical Cline/Junie files while preserving unrelated files and directories.
The `--keep-guidance` option preserves active and historical guidance.
When cleanup removes a shared root, the result warns that every compatible
agent reading that root is affected.

Human output lists created, updated, unchanged, removed, and failed skill files
accurately. Uninstall failure reasons are sanitized while failed target paths
Expand Down
21 changes: 14 additions & 7 deletions docs/implementation/init-setup-output.md
Original file line number Diff line number Diff line change
Expand Up @@ -64,13 +64,20 @@ preselected, the user deselects tools to retain, and the selection is the
consent. `--yes` removes all configured user-level MCP targets. Project
uninstall deduplicates project config paths and uses one confirmation.

Without `--keep-guidance`, uninstall independently and best-effort removes all
four active skill files at verified roots plus only the historical CLI-owned
files `<scope>/.cline/skills/githits-mcp/SKILL.md` and
`<scope>/.junie/skills/githits-mcp/SKILL.md`. It preserves unrelated skills,
directories, plugin payloads, and credentials. Removing a shared root can
affect every compatible agent that reads that directory. `--keep-guidance`
preserves both active and historical guidance.
Without `--keep-guidance`, interactive user uninstall best-effort removes the
active and historical guidance targets owned by the selected tools. Guidance
usable by any unselected detected tool is retained, including a shared skill or
managed-block target also used by a selected tool. A selected tool also retains
its guidance when its MCP removal fails. Non-interactive `--yes`,
project uninstall, and user uninstall with no configured MCP targets continue
to clean every verified guidance target in their chosen scope. Cleanup removes
all four active skill files plus only the historical CLI-owned files
`<scope>/.cline/skills/githits-mcp/SKILL.md` and
`<scope>/.junie/skills/githits-mcp/SKILL.md`; it preserves unrelated skills,
directories, plugin payloads, and credentials. `--keep-guidance` preserves both
active and historical guidance. When cleanup removes a shared skill
root, the output warns that every compatible agent reading that root is
affected.

Missing files are successful no-ops. A historical Cline or Junie file is
removed only after a complete active shared skill set has been written and
Expand Down
Loading