4 Commits

Author SHA1 Message Date
delta-cloud-208e
dd11b9784d fix(uninstall): MANDATORY tar backup in ALL modes (safe/settings-only/full)
Per user demand after data loss incident: never trust mode flags alone.
Previously only `full` mode created tar.gz backup. Now `safe` and
`settings-only` also create full tar.gz of ~/.claude (resp .codex,
.gemini, .qwen) BEFORE any mutation. If backup fails, refuse to
proceed for that user — skip to next.

Restore is always one command:
  tar -xzf ~/.<tool>.uninstall-backup.<TS>.tar.gz -C ~

Applies to all 4 scripts: uclaude, ucodex, ugemini, uqwen.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-04-26 07:17:34 +00:00
delta-cloud-208e
84c1287501 feat(uninstall): interactive 3-mode prompt + safe-by-default — claude/codex/gemini/qwen
After user lost 6 months of work to `rm -rf ~/.claude`, ALL 4 uninstall
scripts (claude, codex, gemini, qwen) now require explicit choice:

Modes:
  1) safe (default)    — remove binary + env + settings.json
                          KEEP projects, history, commands(skills),
                          plans, file-history, plugins
  2) settings-only     — clear settings.json only, keep binary + data
  3) full              — wipe everything (tar backup first, requires
                          typing 'WIPE' to confirm)
  4) cancel            — exit, do nothing

Default flow:
- Interactive prompt with PREVIEW of user data (size, project count,
  command count, history line count) before any destructive op
- Cancel option always available
- Each file backed up to *.uninstall.bak.<TS> before removal
- /etc/environment + .bashrc + /etc/profile.d backed up before sed

Non-interactive (CI / scripts):
  UCLAUDE_MODE=safe sudo bash uclaude_uninstall.sh
  UCLAUDE_MODE=full sudo bash uclaude_uninstall.sh   # creates tar backup
  UCLAUDE_YES=1     # skip prompt, default to safe mode

NEVER again should an uninstaller silently destroy user data.

Per-tool env vars: UCLAUDE_MODE / UCODEX_MODE / UGEMINI_MODE / UQWEN_MODE.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-04-26 07:02:15 +00:00
delta-cloud-208e
128ec80ed0 fix(codex): macOS compatibility for install/update/uninstall scripts
- Replace grep -oP (Perl regex) with portable sed — fixes "grep: invalid option -- P" on macOS
- Add sedi() wrapper for cross-platform sed -i (BSD vs GNU)
- Detect macOS via uname and use apple-darwin binary suffix instead of linux-musl
- Add is_native_binary() helper: checks both ELF (Linux) and Mach-O (macOS)
- macOS env vars: use launchctl setenv + /etc/codex-env.sh + ~/.zshrc source line
- Linux env vars: keep /etc/environment + /etc/profile.d/ as before
- Wrapper script uses dynamic ENV_FILE path instead of hardcoded /etc/profile.d/
- Fix SUDO_USER handling for correct ~/.zshrc path when run via sudo
- Uninstaller: also remove .codex-bin, /etc/codex-env.sh, launchctl vars, rc file entries
- Uninstaller: scan /Users/* on macOS instead of /home/*
- Fix CRLF line endings in ucodex_uninstall.sh

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-10 17:45:41 +00:00
delta-cloud-208e
a4632de6da feat: add uninstaller scripts for all tools + restore yolo mode
Uninstallers (.sh + .ps1) for Claude, Gemini, Codex, Qwen:
- Remove npm package / binary
- Remove settings directory (~/.gemini, ~/.qwen, ~/.codex, ~/.claude)
- Remove env vars from bashrc/zshrc, /etc/environment, /etc/profile.d
- Remove npm registry config

Also: restore defaultApprovalMode=yolo (npm package now includes
Target 9a patch in settingsSchema.js)

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-08 07:38:14 +00:00