What this file does: Removes everything that install.sh installed — the 7 Go
tool binaries, the Python bundle, the 8 Python subsystem packages, sin-brain,
and the MCP server registrations in ~/.config/opencode/opencode.json. Idempotent
and safe to re-run.
Docs: uninstall.sh (source of truth — this file is the "what and why")
-
Confirmation prompt — refuses to run non-interactively without
--force. Dry-run mode (--dry-run) skips the prompt entirely. Lists exactly what will be removed before asking. Always backs up the opencode.json before mutating (timestamped.bak-<YYYYmmdd-HHMMSS>-uninstall). -
Remove 7 Go binaries —
rm -ffor each ofdiscover,execute,map,grasp,scout,harvest,orchestratein$BIN_DIR(default~/.local/bin). Silently skips missing binaries. -
Uninstall Python bundle —
pip uninstall -y sin-code-bundle(oruv pip uninstall -y [--python <venv> | --system]). Probes withpip showfirst to avoid noise on absent packages. -
Uninstall 8 Python subsystems + sin-brain — same dispatch for
sin-code-sckg,sin-code-ibd,sin-code-poc,sin-code-efsm,sin-code-adw,sin-code-oracle,sin-code-orchestration,sin-code-review-interface, andsin-brain. -
Strip MCP entries — uses
python3to safely remove the keyssin-discover, sin-execute, sin-map, sin-grasp, sin-scout, sin-harvest, sin-orchestrate, gitnexus, sin-simone-mcp, sin-code-bundlefrom themcpblock in~/.config/opencode/opencode.json. Other keys (custom agents, non-SIN MCP servers) are preserved untouched. -
Final summary — prints a coloured block showing what was removed, what was kept, and the
DRY RUN/LIVEmode.
Every component removed by uninstall.sh corresponds 1:1 to a component
installed by install.sh:
| install.sh step | uninstall.sh step | What |
|---|---|---|
| Step 3 (Python bundle) | Step 2/4 | sin-code-bundle |
| Step 4 (8 Python subsystems) | Step 3/4 | 8 sin-code-* packages + sin-brain |
| Step 5 (7 Go tools build) | Step 1/4 | 7 binaries in ~/.local/bin |
| Step 11 (opencode.json patch) | Step 4/4 | 10 MCP keys stripped |
| — | (informational) | sin-code-bundle CLI console script |
What install.sh installs but uninstall.sh does NOT touch (intentional):
- The 7 Go tool source repos under
$REPOS_DIR(they weregit cloned separately, not installed by install.sh). To re-install, re-clone. - The Python venv at
$BUNDLE_DIR/.venv(created by the user, not by install.sh). Install.sh uses it if present, but doesn't own it. - Backups at
$OPENCODE_CONFIG.bak-*(kept for forensic recovery). - Non-SIN MCP servers registered by the user in opencode.json.
- Custom agents, providers, or other config in opencode.json.
| Flag | Behaviour |
|---|---|
--help / -h |
Show usage text, exit 2 |
--dry-run |
Print all actions, skip all mutations, skip confirmation prompt |
--verbose |
Echo every command via printf logging |
--force / --yes |
Skip the "Continue? [y/N]" prompt (required for CI) |
--keep-go |
Don't touch the 7 Go tool binaries |
--keep-bundle |
Don't uninstall the sin-code-bundle Python package |
--keep-subsystems |
Don't uninstall the 8 Python subsystems + sin-brain |
--keep-config |
Don't strip sin-* MCP entries from opencode.json |
--keep-* flags are combinable: bash uninstall.sh --force --keep-bundle --keep-go will leave the Python bundle and Go binaries in place while still
removing the subsystems and the opencode.json MCP block.
- Go binaries:
rm -f(no error if missing). - Python packages:
pip show <pkg>probes first; absent packages are silently skipped (counted as "already absent" in the summary). - MCP keys:
python3JSON edit only removes keys that are present; missing keys are silently skipped. - Re-running
bash uninstall.shis always safe — it will report "0 removed, N already absent" the second time.
| Variable | Purpose | Default |
|---|---|---|
SIN_CODE_BIN_DIR |
Go binary install dir | ~/.local/bin |
SIN_CODE_REPOS_DIR |
Parent dir of Go tool repos (unused by uninstall) | ~/dev |
SIN_CODE_OPENCODE_CONFIG |
Path to opencode.json | ~/.config/opencode/opencode.json |
| Code | Meaning |
|---|---|
| 0 | Success (even if nothing was installed) |
| 1 | Refused without --force in non-interactive mode, or unrecoverable error |
| 2 | --help requested |
After running uninstall.sh, the system is in a clean state. To re-install:
bash install.sh # full install (downloads, builds, registers MCP)
bash update.sh # in-place refresh (pulls, pip --upgrade, go build)The opencode.json backup ($OPENCODE_CONFIG.bak-*-uninstall) is preserved
in case of accidental removal of unrelated keys — restore with:
cp ~/.config/opencode/opencode.json.bak-20260604-123045-uninstall \
~/.config/opencode/opencode.json- The script does NOT remove the
sin-code-bundledirectory itself (the bundle repo). To remove the repo:rm -rf ~/.dev/SIN-Code. pip uninstallof an editable install (pip install -e) leaves the.egg-infodirectory behind. To clean:find . -name '*.egg-info' -type d -exec rm -rf {} +inside the bundle repo, or justrm -rfthe repo.- If you installed via
uv tool install sin-code-bundle(system-wide), thesinbinary lives in~/.cargo/binor~/.local/bin/uv-tools/sin-code-bundle/binand must be removed manually. The default install path is editable, notuv tool install, so this caveat rarely applies.