One command. crab is deliberately not published to crates.io yet — the name is a one-way door — so the installer builds it from the repository for you.
Install
main, and warns you if
~/.cargo/bin is missing from PATH.
It is safe to re-run: it uses cargo install --force, which replaces the binary in
place. That is also the upgrade path.
$ crab --version
crab 0.4.0
No Rust toolchain, or you want a binary with no build step? Take a tarball from Releases — see prebuilt binaries below.
Or build from a clone
If you want the source, or you are working on crab itself. The workspace pins its toolchain in
rust-toolchain.toml (rustfmt and clippy included).
git clone https://github.com/jinpeng/crab-agent
cd crab-agent
cargo install --path crates/crab-cli
Two gotchas worth knowing:
- Re-installing the same version needs
--force:cargo install --force --path crates/crab-cli. cargo install --git …re-resolves every dependency from crates.io, so it needs network even when a local build already works.
Prebuilt binaries
Releases ship tarballs for macOS
aarch64-apple-darwin, Linux x86_64-unknown-linux-gnu and
aarch64-unknown-linux-gnu. Asset names encode both version and target triple.
Requirements
- To build
- A Rust toolchain; the exact channel is pinned in
rust-toolchain.toml. - To run
- None. No Node, no Python, no JVM.
- Network
- Outbound HTTPS to your provider's
base_url, plusweb_fetchtargets if you use that tool. - Shell
bashmust exist for the bash tool. It is not needed for the interactive UI.
Before the first run
You can start with one environment variable:
export CRAB_API_KEY=sk-...
crab
With no config file at all, crab talks to https://api.openai.com/v1 with
gpt-4o-mini. To use anything else, write ~/.crab/config.toml:
default_provider = "deepseek"
[providers.deepseek]
base_url = "https://api.deepseek.com/v1"
model = "deepseek-chat"
api_key = "sk-..." # optional if CRAB_API_KEY is set
context_window = 128000
Environment variables beat the profile field by field, so the same config works on a build machine with a different key. See Providers & models for the full resolution order.
The config holds secrets. Keep it out of any directory you point the
agent at, prefer short-lived keys, and remember that environment variables are inherited by
bash calls — if a key is in your shell, the agent can read it with
env.
Upgrade
Re-run the same command — the script replaces the installed binary in place:
curl -fsSL https://crabagent.ai/install.sh | sh
From a clone, git pull && cargo install --force --path crates/crab-cli does the
same thing.
Config and sessions survive an upgrade. Session format changes bump format_version; a
file without a meta row is treated as version 1 (pre-observability) rather than guessed
at.
Remove
cargo uninstall --path crates/crab-cli
rm -rf ~/.crab # config and the pricing overlay
rm -rf ./.crab # this project's sessions and metrics ledger
The last two delete your usage history. Export it first if you care —
crab metrics --json > metrics.json is a complete dump of the ledger.