Skip to main content

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:

  1. Tears down the gateway service if one is managed
  2. Removes known source wrappers (~/.local/bin/estacoda, ~/.estacoda/bin/estacoda, etc.)
  3. Removes installer-owned PATH entries from shell config files
  4. Removes the managed install directory only if ownership is proven by a valid .install-method.json stamp
  5. 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

MethodDefault uninstall
managed-sourceGateway teardown, wrapper cleanup, PATH cleanup, remove managed install dir (if stamp is trusted and directory is safe). Preserves ~/.estacoda.
manual-sourceGateway teardown, wrapper cleanup, PATH cleanup. Leaves the git checkout alone. Preserves ~/.estacoda.
npm-globalPrints npm uninstall -g estacoda. Package-manager-owned wrappers are not manually removed.
pnpm-globalPrints pnpm remove -g estacoda. Package-manager-owned wrappers are not manually removed.
homebrewPrints brew uninstall estacoda. Tap removal is not automatic.
dockerPrints container/image guidance. Containers, images, and volumes are not removed automatically.
unknownRemoves 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, and installDir
  • Resolves inside the declared installDir

The install directory must be safe:

  • Not /
  • Not $HOME
  • Not ~/.estacoda
  • Basename must be estacoda, estacoda.git, or estacoda-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_HOME to 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/estacoda wrappers are removed best-effort.

Failure modes

SymptomCauseRecovery
"Full purge removes EstaCoda user data... Re-run with --purge --yes"--purge provided without --yesAdd --yes
"Managed-source stamp was not trusted"Stamp missing, invalid, or mismatchedTreats as manual-source; no repo removal
"managed-source installDir is not safe to remove automatically"Install directory outside safe basename listNo directory removal; manual cleanup required
"no managed service was removed"No managed gateway service detectedStop the gateway manually with estacoda gateway stop
"Wrapper left in place (not an EstaCoda source wrapper)"File at wrapper path does not match known markersManual removal if needed
"npm global install detected"Install method is npm-globalRun npm uninstall -g estacoda manually