Uninstall
EstaCoda uninstalls with explicit ownership checks. The default mode removes managed install code, known wrappers, and installer-owned PATH entries while preserving your user data. Full data removal requires an explicit purge confirmation.
Default behavior
estacoda uninstall
Default mode is keep-data. It:
- Tears down the gateway service if one is managed
- Removes known source wrappers (
~/.local/bin/estacoda,~/.estacoda/bin/estacoda, etc.) - Removes installer-owned PATH entries from shell config files
- Removes the managed install directory only if ownership is proven by a valid
.install-method.jsonstamp - Preserves
~/.estacoda— profiles, memory, sessions, config, auth, and trust files
--yes by itself does not delete user data. It only bypasses interactive confirmation for the keep-data uninstall.
Purge user data
estacoda uninstall --purge --yes
Both flags are required. --purge without --yes is refused with an error. Purge removes user data after gateway teardown and install-code cleanup.
If other named profiles exist, the active profile is removed but other profiles are preserved. Bulk named-profile removal requires a future explicit flag. Full purge removes ~/.estacoda only when no other named profiles exist.
Method-specific behavior
| Method | Default uninstall |
|---|---|
managed-source | Gateway teardown, wrapper cleanup, PATH cleanup, remove managed install dir (if stamp is trusted and directory is safe). Preserves ~/.estacoda. |
manual-source | Gateway teardown, wrapper cleanup, PATH cleanup. Leaves the git checkout alone. Preserves ~/.estacoda. |
npm-global | Prints npm uninstall -g estacoda. Package-manager-owned wrappers are not manually removed. |
pnpm-global | Prints pnpm remove -g estacoda. Package-manager-owned wrappers are not manually removed. |
homebrew | Prints brew uninstall estacoda. Tap removal is not automatic. |
docker | Prints container/image guidance. Containers, images, and volumes are not removed automatically. |
unknown | Removes known wrappers and PATH entries best-effort. Preserves all user data. |
Ownership and trust
Managed-source uninstall requires a valid .install-method.json stamp that:
- Declares
method: managed-source - Includes
sourceUrl, branch metadata, andinstallDir - Resolves inside the declared
installDir
The install directory must be safe:
- Not
/ - Not
$HOME - Not
~/.estacoda - Basename must be
estacoda,estacoda.git, orestacoda-source
If the stamp is missing, invalid, or the directory is unsafe, the install is treated as manual-source. A plain git checkout is never deleted just because it resembles EstaCoda.
Wrapper cleanup
The uninstaller inspects these paths:
~/.local/bin/estacoda~/.estacoda/bin/estacoda/usr/local/bin/estacoda$PREFIX/bin/estacoda(Termux)
A wrapper is removed only if it contains known markers ("Generated by scripts/install.sh", "EstaCoda source wrapper", etc.) or symlinks to a known EstaCoda target. Non-EstaCoda files are left in place.
PATH cleanup
The uninstaller inspects .bashrc, .zshrc, .profile, and .bash_profile in $HOME. It removes lines containing PATH= and EstaCoda installer markers. Only installer-added PATH entries are removed. User-customized PATH entries are preserved.
Note: If you manually added
ESTACODA_HOMEto your shell rc files (for example, for dev isolation), you may need to remove those lines manually. The uninstaller only removes installer-added PATH entries.
Unsupported and best-effort behavior
- Native Windows: Uninstall is not supported in v0.1.0.
- WSL2: Best-effort. The uninstaller runs but systemd service teardown may behave differently.
- Termux: System service teardown is skipped. Known
$PREFIX/bin/estacodawrappers are removed best-effort.
Failure modes
| Symptom | Cause | Recovery |
|---|---|---|
| "Full purge removes EstaCoda user data... Re-run with --purge --yes" | --purge provided without --yes | Add --yes |
| "Managed-source stamp was not trusted" | Stamp missing, invalid, or mismatched | Treats as manual-source; no repo removal |
| "managed-source installDir is not safe to remove automatically" | Install directory outside safe basename list | No directory removal; manual cleanup required |
| "no managed service was removed" | No managed gateway service detected | Stop the gateway manually with estacoda gateway stop |
| "Wrapper left in place (not an EstaCoda source wrapper)" | File at wrapper path does not match known markers | Manual removal if needed |
| "npm global install detected" | Install method is npm-global | Run npm uninstall -g estacoda manually |
Related docs
- Installation — install paths and ownership modes
- Updating — update behavior for each install method
- State and Files — where user data lives
- Gateway Operations — gateway service teardown details