{"id":49741050,"url":"https://github.com/lingcoder/crab-code","last_synced_at":"2026-05-26T09:01:25.658Z","repository":{"id":348631025,"uuid":"1199042853","full_name":"lingcoder/crab-code","owner":"lingcoder","description":"🦀 Open-source alternative to Claude Code, built from scratch in Rust. Agentic coding CLI — thinks, plans, and executes with any LLM. Compatible with Claude Code workflows.","archived":false,"fork":false,"pushed_at":"2026-05-01T08:52:18.000Z","size":4182,"stargazers_count":49,"open_issues_count":2,"forks_count":9,"subscribers_count":0,"default_branch":"main","last_synced_at":"2026-05-01T10:27:46.911Z","etag":null,"topics":["agent","agentic-coding","ai","ai-agent","ai-coding","anthropic","claude-code","claude-code-alternative","cli","code-generation","coding-assistant","deepseek","developer-tools","llm","mcp","ollama","open-source","openai","rust","rust-lang"],"latest_commit_sha":null,"homepage":"https://github.com/lingcoder/crab-code","language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/lingcoder.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2026-04-02T02:13:05.000Z","updated_at":"2026-05-01T08:52:22.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/lingcoder/crab-code","commit_stats":null,"previous_names":["crabforge/crab-code","lingcoder/crab-code"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/lingcoder/crab-code","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lingcoder%2Fcrab-code","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lingcoder%2Fcrab-code/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lingcoder%2Fcrab-code/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lingcoder%2Fcrab-code/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/lingcoder","download_url":"https://codeload.github.com/lingcoder/crab-code/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lingcoder%2Fcrab-code/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":33512327,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T03:12:49.672Z","status":"ssl_error","status_checked_at":"2026-05-26T03:12:47.976Z","response_time":63,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["agent","agentic-coding","ai","ai-agent","ai-coding","anthropic","claude-code","claude-code-alternative","cli","code-generation","coding-assistant","deepseek","developer-tools","llm","mcp","ollama","open-source","openai","rust","rust-lang"],"created_at":"2026-05-09T19:00:48.056Z","updated_at":"2026-05-26T09:01:25.640Z","avatar_url":"https://github.com/lingcoder.png","language":"Rust","funding_links":[],"categories":["Terminal-native coding agents"],"sub_categories":["Open Source"],"readme":"\u003cdiv align=\"center\"\u003e\n\n\u003cimg src=\"assets/logo-horizontal.svg\" width=\"360\" alt=\"Crab Code\" /\u003e\n\n**Open-source alternative to Claude Code, built from scratch in Rust.**\n\n[![Rust](https://img.shields.io/badge/Built%20with-Rust-orange?logo=rust)](https://www.rust-lang.org/)\n[![License](https://img.shields.io/badge/License-Apache--2.0-blue.svg)](LICENSE)\n[![CI](https://github.com/lingcoder/crab-code/actions/workflows/ci.yml/badge.svg)](https://github.com/lingcoder/crab-code/actions/workflows/ci.yml)\n[![PRs Welcome](https://img.shields.io/badge/PRs-welcome-brightgreen.svg)](#contributing)\n\n**English** | [**中文**](README.zh-CN.md)\n\n\u003c/div\u003e\n\n---\n\n\u003e **Active Development** — 4700+ tests · 27 crates · ~149k LOC\n\nCrab Code is a Rust-native agentic coding CLI. It aligns with Claude Code's toolset, permission model, and interaction patterns while supporting any LLM provider (Anthropic / OpenAI / DeepSeek / Bedrock / Vertex).\n\n## Quick Start\n\n```bash\ngit clone https://github.com/lingcoder/crab-code.git \u0026\u0026 cd crab-code\ncargo build --release\nexport ANTHROPIC_API_KEY=sk-ant-...\n\n./target/release/crab                   # Interactive TUI\n./target/release/crab \"explain this codebase\"   # Single-shot\n./target/release/crab -p \"fix the bug\"  # Non-interactive\n```\n\nSee `crab --help` for more. Config lives at `~/.crab/config.toml` (snake_case TOML); the full loading \u0026 merge spec is in [`docs/config-design.md`](docs/config-design.md).\n\n## Configuration\n\nConfig sources, low → high priority:\n\n```\ndefaults  \u003c  plugin  \u003c  user  \u003c  project  \u003c  local  \u003c  --config \u003cfile\u003e     (file layer)\n                                                            \u003c\n                                                       env  \u003c  CLI flag    (runtime layer)\n```\n\n- **User**: `~/.crab/config.toml` (or `$CRAB_CONFIG_DIR/config.toml`)\n- **Project**: `$PWD/.crab/config.toml` (committed)\n- **Local**: `$PWD/.crab/config.local.toml` (gitignored)\n- **`--config \u003cpath\u003e`**: CLI-injected file\n- **`-c key.path=value`**: dotted runtime override (TOML grammar; repeatable)\n\nExample `config.toml`:\n\n```toml\napi_provider = \"deepseek\"\nbase_url = \"https://api.deepseek.com/v1\"\nmodel = \"deepseek-chat\"\napi_key = \"sk-...\"           # optional; env wins if both set\n\n[permissions]\nallow = [\"Bash(git:*)\", \"Read\", \"Edit\"]\ndeny  = [\"Bash(rm:*)\"]       # deny always wins over allow\n```\n\n## Environment Variables\n\nEnv (runtime layer) always wins over file. Mutually-exclusive variants apply highest-first.\n\n| Category | Variable | Purpose |\n|----------|----------|---------|\n| Provider | `CRAB_API_PROVIDER` | Override provider: `anthropic`, `openai`, `deepseek`, `bedrock`, `vertex`, `custom` |\n| Provider | `CRAB_API_KEY` | Universal API key (any provider; highest priority) |\n| Provider | `CRAB_MODEL` | Override model name |\n| Provider | `CRAB_BASE_URL` | Universal base URL override |\n| Provider | `CRAB_CONFIG_DIR` | Relocate config root (default `~/.crab/`) |\n| Provider | `ANTHROPIC_API_KEY` / `ANTHROPIC_AUTH_TOKEN` | Anthropic provider only |\n| Provider | `ANTHROPIC_BASE_URL` | Anthropic base URL (only when `CRAB_API_PROVIDER=anthropic`) |\n| Provider | `OPENAI_API_KEY` | OpenAI provider |\n| Provider | `OPENAI_BASE_URL` | OpenAI base URL (only when `CRAB_API_PROVIDER=openai`) |\n| Provider | `DEEPSEEK_API_KEY` | DeepSeek provider |\n| Provider | `DEEPSEEK_BASE_URL` | DeepSeek base URL (only when `CRAB_API_PROVIDER=deepseek`) |\n| Bedrock | `AWS_ACCESS_KEY_ID` / `AWS_SECRET_ACCESS_KEY` | Static credentials |\n| Bedrock | `AWS_SESSION_TOKEN` | Optional session token (temporary credentials) |\n| Bedrock | `AWS_REGION` / `AWS_DEFAULT_REGION` | AWS region |\n| Bedrock | `AWS_ROLE_ARN` | IAM role ARN to assume |\n| Bedrock | `AWS_WEB_IDENTITY_TOKEN_FILE` | OIDC token file (web-identity role assumption) |\n| Bedrock | `AWS_EXTERNAL_ID` | External ID for cross-account role assumption |\n| Bedrock | `AWS_ROLE_SESSION_NAME` | Session name for assumed role |\n| Vertex | `GOOGLE_CLOUD_PROJECT` / `GCLOUD_PROJECT` | GCP project ID |\n| Vertex | `GOOGLE_CLOUD_REGION` | GCP region (default: `us-central1`) |\n| Vertex | `GOOGLE_APPLICATION_CREDENTIALS` | Path to service account key JSON |\n| Shell | `CRAB_SHELL` | Path to bash/zsh binary (overrides auto-detection for the Bash tool) |\n| Shell | `SHELL` | POSIX fallback when `CRAB_SHELL` is unset |\n| Shell | `CRAB_USE_POWERSHELL_TOOL` | Truthy value exposes the `PowerShell` tool on Windows (default off) |\n| Agent | `CRAB_COORDINATOR_MODE` | `1` enables Agent Teams coordinator mode |\n| Agent | `CRAB_AUTO_DREAM` | `1` enables background memory consolidation between sessions |\n| Agent | `CRAB_AUTO_DREAM_MIN_HOURS` | Minimum hours between consolidations (default: 6) |\n| Agent | `CRAB_AUTO_DREAM_MIN_SESSIONS` | Minimum sessions before consolidation triggers (default: 2) |\n| TLS | `CRAB_CA_BUNDLE` | Path to custom CA certificate bundle (PEM) |\n| TLS | `SSL_CERT_FILE` / `SSL_CERT_DIR` | Standard OpenSSL CA overrides |\n\n## Comparison\n\n| | Crab Code | Claude Code | OpenCode| Codex CLI |\n|--|-----------|-------------|---------|-----------|\n| Open Source | Apache 2.0 | Proprietary | MIT | Apache 2.0 |\n| Language | Rust | TypeScript | TypeScript | Rust |\n| Models | Any provider | Anthropic | Any provider | OpenAI only |\n| MCP | 3 transports | 6 transports | LSP | 2 transports |\n\n## Architecture\n\n27 Rust crates in 4 layers. See [`docs/architecture.md`](docs/architecture.md) for details.\n\n```\nEntry     cli · daemon · acp\nEngine    agents · engine · session · tui · remote\nService   api · tools · commands · hooks · mcp · skills · plugin · telemetry · ide · sandbox · swarm · cron · fs · memory · process\nFoundation core · utils · config · auth\n```\n\n## Build \u0026 Test\n\n```bash\ncargo build --workspace\ncargo nextest run --workspace          # or: cargo test --workspace\ncargo clippy --workspace -- -D warnings\n```\n\n## Contributing\n\nPRs welcome.\n\n## License\n\n[Apache License 2.0](LICENSE)\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flingcoder%2Fcrab-code","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Flingcoder%2Fcrab-code","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flingcoder%2Fcrab-code/lists"}