Docs
Refer friends. Keep the rewards coming!Your friend can unlock up to 10M tokens · earn up to 30% revenue share.
+500K TokensGenerate link

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 methodCommon entryProgram directoryUser data directory
Installer scriptcurl -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".

bash
command -v crabcode
crabcode --version
command -v crabcode
crabcode --version

If command -v crabcode prints nothing but the binary exists, PATH is the issue.

bash
ls -la "$HOME/.crabcode/bin/crabcode" "$HOME/.local/share/crabcode/crabcode" 2>/dev/null
ls -la "$HOME/.crabcode/bin/crabcode" "$HOME/.local/share/crabcode/crabcode" 2>/dev/null

Temporarily add the actual program directory:

bash
# 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.

ShellConfig fileLine
zsh~/.zshrcexport PATH="$HOME/.crabcode/bin:$PATH"
bash~/.bashrc or ~/.bash_profileexport PATH="$HOME/.crabcode/bin:$PATH"
fish~/.config/fish/config.fishset -gx PATH $HOME/.crabcode/bin $PATH

Reload the shell config or open a new terminal:

bash
source ~/.zshrc
source ~/.zshrc

If 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:

powershell
Get-Command crabcode
crabcode --version
Get-Command crabcode
crabcode --version

If the command is missing, inspect user Path:

powershell
[Environment]::GetEnvironmentVariable("Path", "User")
[Environment]::GetEnvironmentVariable("Path", "User")

First locate the real program directory:

powershell
# 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:

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:

bash
${CRABCODE_HOME:-$HOME/.crabcode}/bin
${CRABCODE_HOME:-$HOME/.crabcode}/bin

The Windows CN mirror script puts program files here by default:

powershell
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:

  1. CRABCODE_CONFIG_DIR: explicit config directory, highest priority.
  2. CRABCODE_HOME: home base, default config lands in <CRABCODE_HOME>/.crabcode.
  3. Unset: real home under ~/.crabcode.

Upgrade

Re-run the same install method.

bash
curl -fsSL https://updates.acosmi.com/crabcode/install.sh | sh
curl -fsSL https://updates.acosmi.com/crabcode/install.sh | sh

Windows CN mirror script:

powershell
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:

bash
# 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:

powershell
# 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:

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.

bash
rm -rf "$HOME/.crabcode"
rm -f "$HOME/.crabcode.json"
rm -rf "$HOME/.crabcode"
rm -f "$HOME/.crabcode.json"

Windows:

powershell
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

SymptomCheck firstFix
crabcode: command not foundcommand -v crabcode, whether the program dir existsAdd the actual program dir to PATH and reopen terminal
Current shell works, new shell failsWrong shell config filezsh uses ~/.zshrc; bash uses ~/.bashrc or ~/.bash_profile
Windows cannot find commandUser Path includes the real program directoryCN mirror uses %LOCALAPPDATA%\CrabCode or %CRABCODE_HOME%; international direct uses the versioned directory
Upgrade still runs old versionOld directory appears earlier in PATHRemove stale Path entries and check command -v crabcode
Remove program onlyProgram dir vs data dirDelete only the program dir, not ~/.crabcode
Reset all stateBack up sessions/settings firstDelete program dir + ~/.crabcode + ~/.crabcode.json