Crab Code CLI
An open-source Rust terminal agent: any model from DeepSeek to Bedrock, layered settings and allow and deny permission lists.
- 77 ★ on the repository
- Last commit
- MIT
Broad access
Why this level
- The agent runs shell commands and edits files with your user's rights.
- Prompts and code fragments go to the chosen model provider.
Install
Manual install
git clone https://github.com/lingcoder/crab-code.git && cd crab-codeThen `cargo build --release`, a provider key and `./target/release/crab`.
Access and checks
How we reviewBroad accessThe tool can change data, run commands or handle secrets.
- The agent runs shell commands and edits files with your user's rights.
- Prompts and code fragments go to the chosen model provider.
This is third-party code. Review the repository files before installing.
What it does
Crab Code is a terminal coding agent written from scratch in Rust. It mirrors the toolset, permission model and interaction habits of Claude Code but connects to models from Anthropic, OpenAI, DeepSeek, Bedrock, Vertex or a custom endpoint. You can run an interactive terminal UI with `crab`, a one-shot question `crab "explain this codebase"` and a non-interactive mode `crab -p "fix the bug"`. Settings merge from several layers: defaults, plugin, user, project, a local file, the `--config` flag, environment variables and flags. Permissions use `allow` and `deny` lists where deny wins over allow. Inside are 25 crates covering tools, hooks, MCP, ACP, skills, plugins, cron, memory and an agent team mode.
Who it is for. Developers who want an open-source agent in the spirit of Claude Code with a choice of model down to DeepSeek or a custom API endpoint.
Good fit when
- You want to work with DeepSeek or your own model server while keeping a familiar agent interface.
- You need permission rules like `Bash(git:*)` and a project-level ban on `Bash(rm:*)`.
- The same agent has to run from Bedrock or Vertex clouds.
- You need non-interactive `crab -p` in a script or CI.
- The agent team mode through `CRAB_COORDINATOR_MODE` interests you.
Not a fit when
- You need a stable prebuilt release: the project is under active development and installs only from source.
- The agent must run in an OS sandbox: the README does not mention one.
- You need the full set of MCP transports like Claude Code has: Crab Code has three.
Example request
crab -p "fix the failing unit test in src/parser" with the DeepSeek model and permission only for `Read`, `Edit` and `Bash(git:*)`.Limitations
The project is under active development and builds from source: Git and Rust with `cargo build --release` are required. You need an API key of the chosen provider, for example `ANTHROPIC_API_KEY`, `OPENAI_API_KEY` or `DEEPSEEK_API_KEY`, or AWS and Google Cloud credentials. The universal `CRAB_API_KEY`, `CRAB_API_PROVIDER` and `CRAB_BASE_URL` variables override the rest. The agent runs shell commands and edits files with your user's rights, so set up the `allow` and `deny` lists. The author compares the project with Claude Code but presents it as an independent implementation.
How to disable. Delete the built `crab` binary and the repository clone. User settings live in `~/.crab/` and are removed by hand, project settings in `.crab/`.
FAQ
How do I install Crab Code?
Clone the repository and run `cargo build --release`. The binary appears at `./target/release/crab`, and before running you set a provider key, for example `export ANTHROPIC_API_KEY=...`.
How do I connect DeepSeek?
Set `api_provider = "deepseek"`, `base_url` and `model` in `~/.crab/config.toml` and pass the key through `DEEPSEEK_API_KEY`. Environment variables take priority over the file.
Where is configuration stored?
User settings in `~/.crab/config.toml`, project settings in `.crab/config.toml` inside the project and local ones in `.crab/config.local.toml`. `CRAB_CONFIG_DIR` relocates the config root.
What does background memory consolidation do?
With `CRAB_AUTO_DREAM=1` memory is consolidated in the background between sessions. By default it runs no sooner than 6 hours and 2 sessions apart.
How does Crab Code differ from Claude Code?
The code is open under MIT and written in Rust. It works with any provider, and Claude Code has six MCP transports against three in Crab Code.
Discussion
No questions or reviews yet.
Related
CLI toolsA Rust coding agent with a native GUI, a terminal mode, an ACP mode for Zed and an MCP server
A small terminal coding agent in Rust: bring your own API key or local model, per-turn cost, real undo and session branches
A Rust SDK for coding agents and the ready-made abstract CLI: REPL, 34 tools, MCP, graph memory, Anthropic and OpenAI, JSON output for CI
Rust coding agent for the terminal and CI built around DeepSeek models that reads code, edits files and runs commands
MCP servers that observe an app as a black box and rebuild a feature from a behavioral spec, with no access to the original code
A Rust coding agent for the terminal with parallel agents, goals, Claude Code-format plugins and your own model endpoint.
README in short
The README comparison table puts Crab Code next to Claude Code, OpenCode and Codex CLI: MIT, Rust, any model, three MCP transports. Project layers are entry, engine, services and foundation.