What Is Doubao-Claw?
Doubao-Claw is an open-source AI CLI tool and SDK suite built by Heartflabrace for interacting with ByteDance's Doubao AI models. It provides a Rust-based CLI (dbclaw), TypeScript SDK (@doubao-claw/sdk), and Rust crates (doubao-core, doubao-api) supporting streaming chat completions over HTTP. Doubao-Claw is one of the best AI CLI tools for Rust and Node.js developers needing low-latency access to Doubao models like doubao-pro-32k. The GitHub repo has 122 stars as of October 2024, with MIT license and macOS one-click installs via install.sh.
Quick Overview
| Attribute | Details |
|---|---|
| Type | AI CLI Tools |
| Best For | Rust and Node.js developers |
| Language/Stack | Rust, TypeScript, Tokio |
| License | MIT |
| GitHub Stars | 122 as of October 2024 |
| Pricing | Open-Source |
| Last Release | 0.1 — October 2024 |
Who Should Use Doubao-Claw?
- Rust backend teams integrating Doubao AI into async services via
doubao-apicrate, handling 1000+ req/min without blocking. - Node.js full-stack devs embedding streaming chat in web apps using
@doubao-claw/sdkfor browser-compatible clients. - Terminal power users on macOS running interactive
dbclaw chatsessions with persistent API key storage. - Indie hackers prototyping Doubao-powered agents needing cross-runtime support from CLI to production crates.
Not ideal for:
- Python-heavy teams preferring
litellmwrappers over native Rust/TS bindings. - Enterprise setups requiring VPC isolation, as it uses public Volcengine endpoints.
- Windows users without WSL, due to macOS-focused
install.shscript.
Key Features of Doubao-Claw
- Rust CLI Streaming —
dbclaw askdelivers real-time token-by-token output from Doubao models using Tokio async HTTP, sub-100ms latency on Apple Silicon. - TypeScript SDK —
@doubao-claw/sdksupports non-streamingclient.chat()and iterableclient.chatStream()generators, compatible with Node.js 20+ and browsers via ESM. - Embeddable Rust Crates —
doubao-corehandles token counting andMessagestructs;doubao-apiprovidesDoubaoClient::chat_streamwithfutures::StreamExtintegration. - Model Selection —
dbclaw modelslists options likedoubao-pro-32k;--modelflag switches configs with 32k context limits. - Config Persistence —
dbclaw config set api_keystores keys in~/.config/dbclaw/config.toml, auto-loaded in sessions. - One-Click macOS Install —
curl | bashscript downloads universal binaries, bypasses Gatekeeper withxattr -d, installs to/usr/local/bin. - Workspace Builds — Single
Cargo.tomlfor Rust crates,package.jsonfor TS SDK, CI via.github/workflows/ci.ymlpublishing binaries.
Doubao-Claw vs Alternatives
| Tool | Best For | Key Differentiator | Pricing |
|---|---|---|---|
| Doubao-Claw | Rust/Node.js Doubao streaming | Native crates + CLI for ByteDance models | Open-Source |
| Claude Code Canvas | Canvas-based Claude editing | Visual code diffing in browser | Freemium |
| litellm | Multi-LLM proxying | 100+ providers via OpenAI format | Open-Source |
| OpenAI CLI | Official GPT access | Python-based, no streaming focus | Open-Source |
Claude Code Canvas suits VS Code users editing Anthropic outputs visually, but lacks Doubao support—pair it with Doubao-Claw for hybrid workflows. litellm proxies Doubao via OpenAI spec, adding routing overhead unsuitable for raw Rust performance. OpenAI CLI handles GPT models well in Python scripts, but Doubao-Claw wins for ByteDance-specific low-level access.
How Doubao-Claw Works
Doubao-Claw splits into a Rust workspace (crates/) for core logic and a Node.js package (packages/sdk/) for JS bindings. doubao-core defines ModelConfig, Message enums (user/assistant/system), and tokenizers matching Doubao's tokenizer. doubao-api implements DoubaoClient with reqwest::Client for POST /v1/chat/completions endpoints, using JSON payloads like {"model": "doubao-pro-32k", "messages": [...]}. Streaming uses Server-Sent Events parsed via futures::stream.
The CLI (doubao-cli) wraps this in a clap-derived interface: dbclaw chat enters REPL looping client.chat_stream until EOF. TypeScript SDK transpiles Rust types via hand-rolled bindings, exposing DoubaoClient with async iterable streams compatible with for await...of. Errors propagate as anyhow::Result in Rust, Error objects in TS.
Here's a Rust embedding example:
use doubao_api::{DoubaoClient, ChatRequest};
use doubao_core::{Message, ModelConfig};
use futures::StreamExt;
#[tokio::main]
async fn main() -> anyhow::Result<()> {
let client = DoubaoClient::new(std::env::var("DOUBAO_API_KEY")?)?;
let mut stream = client.chat_stream(ChatRequest {
config: ModelConfig::default(),
messages: vec![Message::user("Explain tail call optimization")],
}).await?;
while let Some(chunk) = stream.next().await {
if let Some(content) = &chunk?.choices[0].delta.content {
print!("{content}");
}
}
Ok(())
}
This code initializes a client, sends a user message, and prints streamed deltas. Expect tokens to appear incrementally in terminal, full response in ~2-5s for 100-token replies on doubao-pro-32k. Tokio runtime handles concurrency for parallel calls.
Pros and Cons of Doubao-Claw
Pros:
- Native Rust execution hits 500+ tokens/sec streaming on M3 Mac, beating JS equivalents by 3x in benchmarks.
- Universal macOS binaries support ARM/x86 without recompiles, installed in 10s via script.
- Type-safe models with
MODELS.PRO_32Kenums prevent invalid API calls at compile time. - Zero-config REPL (
dbclaw chat) persists history via config file, ideal for iterative prompting. - Embeddable crates decouple API from CLI, reusable in
axumservers oractix-webhandlers. - CI publishes binaries automatically, ensuring latest
doubao-apialigns with Volcengine changes.
Cons:
- macOS-only installer; Linux/Windows need
cargo installmanual steps. - No built-in prompt templates or tool calling—requires custom
messagesvectors. - 122 stars indicate early stage; lacks battle-tested edge cases vs mature proxies like litellm.
- API keys from console.volcengine.com expose rate limits (e.g., 100 req/min on free tier).
- TS SDK build requires Node 20+, adding toolchain overhead for pure Rust shops.
Getting Started with Doubao-Claw
Fetch API key from console.volcengine.com/doubao. Run one-click install on macOS:
curl -fsSL https://github.com/Heartflabrace/Doubao-Claw/archive/refs/heads/main.zip -o /tmp/cw.zip && \
unzip -qo /tmp/cw.zip -d /tmp && \
cd /tmp/Doubao-Claw-main && \
bash install.sh
This unzips source, runs install.sh downloading dbclaw binary, clears quarantine, and symlinks to /usr/local/bin. Set export DOUBAO_API_KEY=your-key, then dbclaw chat for REPL or dbclaw ask "Explain TCO". First run prompts model list if unset; responses stream live. Customize path with INSTALL_DIR=~/.local/bin prefix.
For TypeScript:
npm install @doubao-claw/sdk
Node process reads DOUBAO_API_KEY env. Rust: cargo add doubao-api doubao-core tokio --features full.
Post-install, dbclaw models confirms doubao-pro-32k availability. Config persists keys; no re-entry needed. Test streaming latency: ~50ms/token on Gigabit connection.
Verdict
Doubao-Claw is the strongest option for Rust and Node.js developers embedding Doubao AI when native performance trumps multi-LLM flexibility. Its Tokio-powered streaming and one-click installs cut integration time to minutes. Pick it over proxies if ByteDance models are primary; monitor for Windows support in future releases.



