Install, PATH, and uninstall
TUI install paths, environment-variable issues, command not found, upgrades, and uninstall cleanup.
Identify your install path first
CrabCode TUI has multiple public install paths. PATH troubleshooting and uninstall steps depend on which one you used.
| Install method | Common entry | Program directory | User data directory |
|---|---|---|---|
| Installer script | curl -fsSL https://updates.acosmi.com/crabcode/install.sh | sh or release install.sh | ${CRABCODE_HOME:-$HOME/.crabcode}/bin | ~/.crabcode |
| Downloads-page direct block | /downloads international macOS / Linux command block | ~/.local/share/crabcode | ~/.crabcode |
| Windows CN mirror script | /downloads China Windows PowerShell command, or install-win.ps1 | %CRABCODE_HOME%; if unset, %LOCALAPPDATA%\CrabCode | %USERPROFILE%\.crabcode |
| Windows international direct block | /downloads international Windows PowerShell command | %LOCALAPPDATA%\crabcode\crabcode-<version>-win-x64 | %USERPROFILE%\.crabcode |
The user data directory column assumes CRABCODE_CONFIG_DIR and CRABCODE_HOME are unset. User data stores login, settings, sessions, memory, plugins, and debug logs. Do not delete all of ~/.crabcode or %USERPROFILE%\.crabcode if you only want to remove the program.
Installed, but the command will not open
First separate "not installed" from "PATH not active".
command -v crabcode
crabcode --versioncommand -v crabcode
crabcode --versionIf command -v crabcode prints nothing but the binary exists, PATH is the issue.
ls -la "$HOME/.crabcode/bin/crabcode" "$HOME/.local/share/crabcode/crabcode" 2>/dev/nullls -la "$HOME/.crabcode/bin/crabcode" "$HOME/.local/share/crabcode/crabcode" 2>/dev/nullTemporarily add the actual program directory:
# default install.sh path
export PATH="$HOME/.crabcode/bin:$PATH"
# downloads-page international direct path
export PATH="$HOME/.local/share/crabcode:$PATH"# default install.sh path
export PATH="$HOME/.crabcode/bin:$PATH"
# downloads-page international direct path
export PATH="$HOME/.local/share/crabcode:$PATH"Once that works, persist the matching line in your shell config.
| Shell | Config file | Line |
|---|---|---|
| zsh | ~/.zshrc | export PATH="$HOME/.crabcode/bin:$PATH" |
| bash | ~/.bashrc or ~/.bash_profile | export PATH="$HOME/.crabcode/bin:$PATH" |
| fish | ~/.config/fish/config.fish | set -gx PATH $HOME/.crabcode/bin $PATH |
Reload the shell config or open a new terminal:
source ~/.zshrcsource ~/.zshrcIf you installed with the downloads-page international direct block, replace ~/.crabcode/bin with ~/.local/share/crabcode.
Windows PATH troubleshooting
Windows has two public install paths: the CN mirror script adds the install root to the user Path, while the international direct block adds a versioned directory. Open a new PowerShell and check:
Get-Command crabcode
crabcode --versionGet-Command crabcode
crabcode --versionIf the command is missing, inspect user Path:
[Environment]::GetEnvironmentVariable("Path", "User")[Environment]::GetEnvironmentVariable("Path", "User")First locate the real program directory:
# CN mirror script / install-win.ps1
$CnBin = if ($env:CRABCODE_HOME) { $env:CRABCODE_HOME } else { "$env:LOCALAPPDATA\CrabCode" }
# International direct block: replace <version> with the version from the downloads-page command
$IntlBin = "$env:LOCALAPPDATA\crabcode\crabcode-<version>-win-x64"
@($CnBin, $IntlBin) | ForEach-Object {
if (Test-Path (Join-Path $_ "crabcode.exe")) { $_ }
}# CN mirror script / install-win.ps1
$CnBin = if ($env:CRABCODE_HOME) { $env:CRABCODE_HOME } else { "$env:LOCALAPPDATA\CrabCode" }
# International direct block: replace <version> with the version from the downloads-page command
$IntlBin = "$env:LOCALAPPDATA\crabcode\crabcode-<version>-win-x64"
@($CnBin, $IntlBin) | ForEach-Object {
if (Test-Path (Join-Path $_ "crabcode.exe")) { $_ }
}Add the directory that exists, then close and reopen PowerShell:
# CN mirror script / install-win.ps1
$Bin = if ($env:CRABCODE_HOME) { $env:CRABCODE_HOME } else { "$env:LOCALAPPDATA\CrabCode" }
# For the international direct block, use this instead
# $Bin = "$env:LOCALAPPDATA\crabcode\crabcode-<version>-win-x64"
$UserPath = [Environment]::GetEnvironmentVariable("Path", "User")
[Environment]::SetEnvironmentVariable("Path", "$UserPath;$Bin", "User")# CN mirror script / install-win.ps1
$Bin = if ($env:CRABCODE_HOME) { $env:CRABCODE_HOME } else { "$env:LOCALAPPDATA\CrabCode" }
# For the international direct block, use this instead
# $Bin = "$env:LOCALAPPDATA\crabcode\crabcode-<version>-win-x64"
$UserPath = [Environment]::GetEnvironmentVariable("Path", "User")
[Environment]::SetEnvironmentVariable("Path", "$UserPath;$Bin", "User")CRABCODE_HOME and CRABCODE_CONFIG_DIR
CRABCODE_HOME changes CrabCode's home base and can also change where installer scripts place program files. The Unix install.sh puts binaries here by default:
${CRABCODE_HOME:-$HOME/.crabcode}/bin${CRABCODE_HOME:-$HOME/.crabcode}/binThe Windows CN mirror script puts program files here by default:
if ($env:CRABCODE_HOME) { $env:CRABCODE_HOME } else { "$env:LOCALAPPDATA\CrabCode" }if ($env:CRABCODE_HOME) { $env:CRABCODE_HOME } else { "$env:LOCALAPPDATA\CrabCode" }CRABCODE_CONFIG_DIR changes the configuration root, not the program directory. Use it to isolate accounts, settings, sessions, and memory. Do not use it to fix PATH.
Priority:
CRABCODE_CONFIG_DIR: explicit config directory, highest priority.CRABCODE_HOME: home base, default config lands in<CRABCODE_HOME>/.crabcode.- Unset: real home under
~/.crabcode.
Upgrade
Re-run the same install method.
curl -fsSL https://updates.acosmi.com/crabcode/install.sh | shcurl -fsSL https://updates.acosmi.com/crabcode/install.sh | shWindows CN mirror script:
powershell -NoProfile -ExecutionPolicy Bypass -Command "iex (irm 'https://updates.acosmi.com/crabcode/install-win.ps1')"powershell -NoProfile -ExecutionPolicy Bypass -Command "iex (irm 'https://updates.acosmi.com/crabcode/install-win.ps1')"If you used the /downloads international direct block, copy the whole current command block from that page again. Upgrading replaces program files only; it does not remove settings, login, history, or memory under ~/.crabcode / %USERPROFILE%\.crabcode.
Uninstall program files and keep data
macOS / Linux:
# default install.sh program directory
rm -rf "$HOME/.crabcode/bin"
# downloads-page international direct program directory
rm -rf "$HOME/.local/share/crabcode"# default install.sh program directory
rm -rf "$HOME/.crabcode/bin"
# downloads-page international direct program directory
rm -rf "$HOME/.local/share/crabcode"Then remove the matching PATH line from ~/.zshrc, ~/.bashrc, ~/.bash_profile, or ~/.config/fish/config.fish.
Windows:
# CN mirror script / install-win.ps1
Remove-Item -Recurse -Force "$env:LOCALAPPDATA\CrabCode"
# If CRABCODE_HOME was set before install, remove that custom program directory
if ($env:CRABCODE_HOME) { Remove-Item -Recurse -Force "$env:CRABCODE_HOME" }
# International direct block
Remove-Item -Recurse -Force "$env:LOCALAPPDATA\crabcode"# CN mirror script / install-win.ps1
Remove-Item -Recurse -Force "$env:LOCALAPPDATA\CrabCode"
# If CRABCODE_HOME was set before install, remove that custom program directory
if ($env:CRABCODE_HOME) { Remove-Item -Recurse -Force "$env:CRABCODE_HOME" }
# International direct block
Remove-Item -Recurse -Force "$env:LOCALAPPDATA\crabcode"Then remove stale %LOCALAPPDATA%\CrabCode, %CRABCODE_HOME%, or crabcode-<version>-win-x64 entries from the user Path. You can also rewrite it with PowerShell:
$Remove = @("$env:LOCALAPPDATA\CrabCode", "$env:LOCALAPPDATA\crabcode\crabcode-<version>-win-x64")
if ($env:CRABCODE_HOME) { $Remove += $env:CRABCODE_HOME }
$NextPath = ([Environment]::GetEnvironmentVariable("Path", "User") -split ';') |
Where-Object { $_ -and ($Remove -notcontains $_) }
[Environment]::SetEnvironmentVariable("Path", ($NextPath -join ';'), "User")$Remove = @("$env:LOCALAPPDATA\CrabCode", "$env:LOCALAPPDATA\crabcode\crabcode-<version>-win-x64")
if ($env:CRABCODE_HOME) { $Remove += $env:CRABCODE_HOME }
$NextPath = ([Environment]::GetEnvironmentVariable("Path", "User") -split ';') |
Where-Object { $_ -and ($Remove -notcontains $_) }
[Environment]::SetEnvironmentVariable("Path", ($NextPath -join ';'), "User")Fully remove local data
Only do this when you no longer need local login, history, memory, plugins, or settings.
rm -rf "$HOME/.crabcode"
rm -f "$HOME/.crabcode.json"rm -rf "$HOME/.crabcode"
rm -f "$HOME/.crabcode.json"Windows:
Remove-Item -Recurse -Force "$env:USERPROFILE\.crabcode"
Remove-Item -Force "$env:USERPROFILE\.crabcode.json"Remove-Item -Recurse -Force "$env:USERPROFILE\.crabcode"
Remove-Item -Force "$env:USERPROFILE\.crabcode.json"If you set CRABCODE_CONFIG_DIR, remove that custom directory too.
Quick diagnosis
| Symptom | Check first | Fix |
|---|---|---|
crabcode: command not found | command -v crabcode, whether the program dir exists | Add the actual program dir to PATH and reopen terminal |
| Current shell works, new shell fails | Wrong shell config file | zsh uses ~/.zshrc; bash uses ~/.bashrc or ~/.bash_profile |
| Windows cannot find command | User Path includes the real program directory | CN mirror uses %LOCALAPPDATA%\CrabCode or %CRABCODE_HOME%; international direct uses the versioned directory |
| Upgrade still runs old version | Old directory appears earlier in PATH | Remove stale Path entries and check command -v crabcode |
| Remove program only | Program dir vs data dir | Delete only the program dir, not ~/.crabcode |
| Reset all state | Back up sessions/settings first | Delete program dir + ~/.crabcode + ~/.crabcode.json |