fabro/docs/ideation/2026-04-08-fabro-uninstall-ideation.md
Bryan Helmkamp 166b60e3b1 feat(cli): add fabro uninstall command
Adds a top-level `fabro uninstall` command that reverses `fabro install`
and `install.sh`. Defaults to dry-run (preview) mode, requiring `--yes`
to execute.

Features:
- Inventory and dry-run preview with sizes and `--json` support
- Server shutdown (guarded — only when server is running)
- Safety guardrails (refuses to delete /, $HOME, or dirs without markers)
- Shell config cleanup (exact `# fabro` sentinel match, PATH validation,
  atomic write via temp+rename)
- Binary status reporting with tailored brew/cargo/manual hints
- Exit code: 0 on success, 1 on critical failure

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-08 16:31:32 -04:00

4.2 KiB

date topic focus
2026-04-08 fabro-uninstall add `fabro uninstall` command — the opposite of install

Ideation: fabro uninstall Command

Codebase Context

  • fabro install creates ~/.fabro/ with settings.toml, certs/, storage/ (secrets, server state, logs, scratch, store, artifacts), skills/, workflows/, logs/, tmp/
  • install.sh modifies shell configs (.zshrc/.bashrc/.config/fish) adding PATH entries with # fabro sentinel comment
  • Home (fabro-util) and Storage (fabro-config) structs are canonical path registries
  • system prune provides the established dry-run/--yes/size-reporting UX pattern
  • server stop handles graceful SIGTERM→SIGKILL with socket cleanup
  • Binary installed to ~/.fabro/bin/fabro by install.sh; brew/cargo installs go elsewhere

Ranked Ideas

1. Core Mirror Uninstall

Description: fabro uninstall removes ~/.fabro/ entirely, using Home and Storage structs as the canonical path registry. Compose existing deletion logic rather than writing new teardown code. Rationale: Home/Storage structs enumerate every path, so future paths added to install automatically appear in uninstall — zero maintenance drift. Downsides: None significant — table stakes. Confidence: 95% Complexity: Low Status: Unexplored

2. Server Shutdown First

Description: Before removing any files, detect a running server and gracefully stop it, reusing server stop logic (SIGTERM→SIGKILL). Only then proceed with file deletion. Rationale: Deleting files under a running server creates orphaned processes, dangling sockets, and corrupt state. Downsides: None — correctness requirement. Confidence: 95% Complexity: Low Status: Unexplored

3. Shell Config Cleanup

Description: Remove PATH lines from .zshrc/.bashrc/.config/fish that install.sh added, using the # fabro sentinel comment as grep target. Rationale: Stale PATH entries are the #1 complaint after CLI uninstalls. Sentinel comment makes surgical removal safe. Downsides: Shell config surgery requires careful testing across shells. Confidence: 85% Complexity: Medium Status: Unexplored

4. Dry-Run by Default

Description: Follow system prune pattern: list everything that would be removed with sizes, require --yes to confirm. Support --json. Rationale: Already proven UX in the codebase. Prevents "oops" moments. Downsides: None. Confidence: 95% Complexity: Low Status: Unexplored

5. Binary Self-Removal

Description: If binary lives inside ~/.fabro/bin/ (install.sh path), delete it as final step. For brew/cargo, print a hint instead. Rationale: Users expect "uninstall" to mean "gone." Simple conditional based on current_exe() path. Downsides: Self-deleting binary must be last step. Detection heuristic could be wrong if user moved the binary. Confidence: 75% Complexity: Low Status: Unexplored

Rejection Summary

# Idea Reason Rejected
1 Selective component uninstall YAGNI — users can back up manually
2 GitHub App deregistration Scope creep — remote API during teardown is fragile
3 Export before destroy Gold-plating — cp -r ~/.fabro suffices
4 Telemetry farewell event Marginal value, unwelcome phoning home
5 Install manifest Over-engineering for small deterministic footprint
6 Per-repo cascade cleanup Filesystem scanning is slow and presumptuous
7 Secure secrets shredding Security theater on modern SSDs
8 Reframe as system reset Poor discoverability
9 Doctor extension Mixing diagnostic and destructive ops
10 Install --undo flag Terrible discoverability
11 Teardown facet trait Premature abstraction for ~5 steps
12 Event-sourced uninstall Requires rewriting install first
13 Restoration script Worse version of export (already cut)
14 Server-mediated uninstall Circular dependency
15 Manifest + Selective Both halves cut
16 Doctor-informed uninstall Coupling for no benefit

Session Log

  • 2026-04-08: Initial ideation — ~40 generated across 5 agents, deduped to 22, 5 survived. All 5 accepted as facets of one command. Proceeding to plan.