Skip to content

feat: add uninstall script#323

Open
jithinraj wants to merge 1 commit intogarrytan:mainfrom
jithinraj:feat/uninstall-script
Open

feat: add uninstall script#323
jithinraj wants to merge 1 commit intogarrytan:mainfrom
jithinraj:feat/uninstall-script

Conversation

@jithinraj
Copy link

@jithinraj jithinraj commented Mar 22, 2026

Summary

  • Adds bin/gstack-uninstall to cleanly remove gstack from a system. Stops running browse daemons, removes all skill installs across Claude, Codex, and Kiro hosts, cleans per-project and global state. Closes No uninstall script. #273.

Changes

  • bin/gstack-uninstall: single-file uninstall script following existing bin/ conventions
  • Stops browse daemons (SIGTERM with 2s graceful window, SIGKILL fallback)
  • Removes global Claude skills (~/.claude/skills/gstack + per-skill symlinks)
  • Removes project-local Claude skills (--local installs in .claude/skills/)
  • Removes Codex skills (~/.codex/skills/gstack*)
  • Removes Kiro skills (~/.kiro/skills/gstack*)
  • Removes per-project .agents/skills/gstack* sidecar, .gstack/ state, .gstack-worktrees/
  • Removes global ~/.gstack/ state (config, analytics, sessions, projects, repos, installation-id)
  • Cleans /tmp/gstack-* session and sync files
  • Flags: --force (skip confirmation), --keep-state (preserve ~/.gstack/ data)
  • NOT removed: ~/Library/Caches/ms-playwright/ (shared), ~/.gstack-dev/ (contributor-only)

Test Coverage

All existing tests pass (1/2 pre-existing failure on main). Skill docs fresh for both Claude and Codex hosts.

Pre-Landing Review

No issues found.

TODOS

Addresses #273 (uninstall script). No other TODOS affected.

Test plan

  • bash -n bin/gstack-uninstall passes syntax check
  • bin/gstack-uninstall --help prints usage
  • bin/gstack-uninstall (interactive) lists targets and prompts before removing
  • bin/gstack-uninstall --force removes all gstack artifacts
  • bin/gstack-uninstall --keep-state --force removes skills but preserves ~/.gstack/
  • Re-running after uninstall prints "Nothing to remove"
  • GSTACK_STATE_DIR env override works for isolated testing
  • bun test passes (no regressions)
  • bun run skill:check reports 27/27 skills healthy

@jithinraj jithinraj force-pushed the feat/uninstall-script branch 3 times, most recently from dc5fa46 to 7094f21 Compare March 22, 2026 17:49
@jithinraj jithinraj force-pushed the feat/uninstall-script branch from 7094f21 to 899320e Compare March 23, 2026 17:54
Copy link

@gaaschk gaaschk left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I just used this in my environment! works great!

@jithinraj jithinraj force-pushed the feat/uninstall-script branch from 899320e to 107af75 Compare March 25, 2026 10:08
Closes garrytan#273.

Adds bin/gstack-uninstall to cleanly remove gstack from a system:
- Stops running browse daemons (SIGTERM with graceful fallback)
- Removes Claude skills (~/.claude/skills/gstack + per-skill symlinks)
- Removes Codex skills (~/.codex/skills/gstack*)
- Removes per-project .agents/ sidecar and .gstack/ state
- Removes global ~/.gstack/ state directory
- Cleans up /tmp session files

Supports --force (skip confirmation), --keep-state (preserve
~/.gstack/ data), and GSTACK_STATE_DIR env override for testing.

Uses set -uo pipefail (no -e) so uninstall never aborts partway.
Handles broken symlinks. Follows existing bin/ script conventions.
@jithinraj jithinraj force-pushed the feat/uninstall-script branch from 107af75 to 54c8883 Compare March 25, 2026 11:09
@jithinraj
Copy link
Author

Thanks for testing @gaaschk! I pushed a small update after your approval — wanted to be transparent about what changed:

  • Renamed removed array to REMOVED to match the repo's UPPER_CASE variable convention
  • Added a $HOME unset guard at the top (safety edge case)
  • Enhanced the confirmation preview to show per-skill symlinks, browse state details, and running daemon PIDs

All changes are additive/cosmetic — the core uninstall logic you tested is unchanged. Happy to have you re-verify if you'd like.

@jithinraj
Copy link
Author

Correction to my previous comment — I understated the scope of changes. Here's the full list of what changed after your approval:

New functionality:

  • Added project-local Claude skills cleanup (--local installs in .claude/skills/)
  • Added .gstack-worktrees/ removal (test worktree isolation dirs)
  • Added /tmp/gstack-sync-* to temp file cleanup

Safety:

  • Added $HOME unset guard at the top

Convention alignment:

  • removedREMOVED (repo convention for top-level vars)
  • Loop vars renamed to _UPPER prefix (link_LINK, item_ITEM, etc.)
  • exit 0 added at end

Confirmation preview:

  • Shows per-skill symlinks hint, browse state details, worktrees, project-local installs, and running daemon PIDs

The core logic you tested (daemon stop, global Claude/Codex/Kiro cleanup, .agents/ sidecar, global state) is structurally the same, but the new project-local and worktrees sections are untested by your review. Apologies for the incomplete summary earlier.

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.

No uninstall script.

2 participants