Skip to content

Blankeos/crabcode

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

340 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

πŸ¦€ crabcode

A purely Rust-based AI CLI coding agent with a beautiful terminal UI for interactive "agentic engineering".

In the words of the buildwithpi.ai creators, 'There are many coding agents, this one is mine'.

It's OpenCode but in pure Rust πŸ¦€ w/ my personal flavors.

~ Carlo (Author)

Crabcode banner

Features

  • Made with Rust - Uses ratatui, crossterm and nucleo (fuzzy search), all fast tech.
  • Notifications - Sounds, desktop notifications, and terminal alert signals are built in.
  • TPS, TTFT, Latency metrics - Also wanted this in opencode, just made it built-in.
  • Opens instantly - one of my main motivations why I made this! :D Very lightweight after build.
  • Terminal UI (TUI) - Beautiful, responsive interface built with ratatui
  • Built for the OpenCode user - works out of the box w/ opencode themes, every UX, and some existing configs so you don't need to force your team to use crabcode.
    • Same UX - carefully ported most of the good UX from OpenCode i.e. shortcuts, etc.
    • Agent System - Switch between PLAN (read-only analysis) and BUILD (implementation) agents with TAB, and custom agents.
    • Multiple Model Support - Works w/ the same models.dev support.
    • Command System - Intuitive commands: /sessions, /new, /connect, /models, /exit + custom commands.
    • Session Management - Create and manage multiple chat sessions
    • Streaming Responses - Real-time streaming of AI responses (w/ aisdk.rs)

Installation

npm install -g crabcode  # npm
bun install -g crabcode  # or bun
cargo binstall crabcode  # or cargo-binstall (prebuilt binary, faster)
cargo install crabcode   # or cargo (build from source)
curl -sSL https://raw.githubusercontent.com/Blankeos/crabcode/main/install.sh | sh # or linux/macos (via curl)

Quick Start

  1. Run crabcode:

    crabcode
  2. Configure your AI model:

    /connect
    
  3. Start coding! Type your questions or requests and press Enter.

Usage

It works (almost) exactly like OpenCode. Just opens faster, with some intuitive changes I like, here are most of them:

  • Opens instantly!
  • Sounds out-of-the-box + clean Desktop notifications!
  • Multiworkspace by default, can run like 3+ sessions in the same instance, just works like a webapp.
  • Ollama Local CLI connections works out-of-the-box.
  • My own remote implementation. Probably worse.
  • My own UX preferences:
    • Can click on [Image #1] tags to open them.
    • Themes has no background, all tranluscent (don't really care right now).
    • Lots of toolcall-shapes inspired by the actual Codex harness.
    • When switching models, you can press ⇆ to change thinking efforts.
    • Copy on select is disabled by default. Copy is two-step in crabcode. Gets annoying in OpenCode, especially w/ clipboard history.

Agent Types

  • PLAN - Read-only analysis and planning agent. Best for understanding codebases, architecture questions, and planning changes.
  • BUILD - Full access implementation agent. Best for writing code, implementing features, and making changes.

Configuration

Your credentials are stored in crabcode's state directory:

  • Default: ~/.local/state/crabcode/auth.json
  • With XDG_STATE_HOME: $XDG_STATE_HOME/crabcode/auth.json

Read the configuration docs here.

Supported Providers

Will be powered by mostly aisdk + models.dev So most of them will work out of the box.

I tried crabcode specifically for these providers:

  • openai (both API key and OAuth, thank you OpenAI for supporting harnesses!)
  • opencode-zen and opencode-go
  • nano-gpt
  • commandcode (Pro)
  • ollama-cli
  • zai
  • ollama-cloud
  • xiaomi-token-plan-sgp
  • minimax
  • fireworks
  • baseten

Feel free to create an issue / add to this list if you tried

Known unsupported providers

I might work harder to support these in the future.

  • Kimi For Coding Subscription - I keep getting 401 but it works in OpenCode, I may have to contact them first. might support later
  • Gemini - It's OAuth + also very unsure. So currently no.
  • Claude Code Subscription - Known to explicitly not like harnesses. So never will, sorry.

Development

Run tests

cargo test

Contributing

Contributions are welcome! Please feel free to submit a Pull Request.

License

This project is licensed under the MIT License - see the LICENSE file for details.

Inspiration

This project was inspired by anomalyco/opencode. Also made this project w/ OpenCode btw, so thank you OpenCode! πŸ™

Scope and Limits

  • Chat, switch models, agents
  • Minimal configurations (I want it to just feel at least like vanilla opencode)
  • The cheapest model providers (GLM, etc.)
  • A ding sound, my only opencode plugin at the moment.
  • No reverse-engineering oauth from big AI (Claude Code, Gemini), at least for now (Don't wanna get in trouble).
  • Exception: ChatGPT oauth (because I use it)
  • Copy chat contents, copy the chat input
  • Image inputs
  • Personal remote usage + Browser client equivalent.
  • ACP w/ Zed? (very far, idk how to do that)
  • No Claude Code oauth spoofing.
  • No plugin ecosystem (If I think it's worth building, just make it built-in and configurable i.e. sounds)
  • No desktop app

Why?

I'm learning rust :D. Built a few TUIs as practice. Also been making AI chat apps on web, so I wanna work on this.

About

πŸ¦€ (WIP) Rust AI CLI Coding Agent with a beautiful terminal UI. Like OpenCode but pure Rust.

Resources

License

Stars

Watchers

Forks

Packages

 
 
 

Contributors