curl -fsSL https://raw.githubusercontent.com/zeroclaw-labs/zeroclaw/master/install.sh | bash
脚本自动检测平台,下载对应预构建二进制,添加到 $PATH。
# 最小构建(~6.6MB,不含 TUI 和硬件支持) curl -fsSL .../install.sh | bash -s -- --minimal # 指定版本 curl -fsSL .../install.sh | bash -s -- --version v0.7.5 # 仅安装到指定目录 curl -fsSL .../install.sh | bash -s -- --prefix ~/.local
需要 Rust Edition 2024(stable ≥ 1.82)
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh
git clone https://github.com/zeroclaw-labs/zeroclaw cd zeroclaw
# 全功能构建 cargo build --release # 最小功能构建 cargo build --release --no-default-features # 使用 just(更方便) just build
cargo install --path . # 或直接使用 ./target/release/zeroclaw --version
首次安装后运行交互式向导,分四个步骤配置核心参数:
zeroclaw onboard
选择 LLM 提供商(Anthropic / OpenAI / Ollama / 自定义)并输入 API Key
设置 Agent alias、人格描述(personality)、默认模型
配置自主级别:supervised(默认)/ autonomous / strict
选配通讯渠道(Discord token、Telegram bot、Email SMTP 等)
~/.zeroclaw/config.toml,可随时手动编辑。# ~/.zeroclaw/config.toml [provider.main] type = "anthropic" # anthropic | openai | ollama | openai-compat api_key = "$ANTHROPIC_API_KEY" model = "claude-sonnet-4-6" [agent.default] alias = "aria" provider = "main" personality = "You are a helpful assistant." workspace = "~/workspace" autonomy = "supervised" # supervised | autonomous | strict [risk] medium_risk_approval = true high_risk_block = true allowed_commands = ["git", "npm", "cargo"] [channel.telegram] bot_token = "$TELEGRAM_BOT_TOKEN" agent = "aria"
| 字段 | 类型 | 说明 |
|---|---|---|
| [provider.*] | table | LLM 提供商定义,支持 fallback chain |
| [agent.*] | table | Agent 定义,每个 alias 一个 |
| [risk] | table | 全局风险策略 |
| [channel.*] | table | 通讯渠道配置 |
| [gateway] | table | HTTP/WebSocket 服务器配置 |
| [memory] | table | 内存引擎路径与向量参数 |
| [sop.*] | table | SOP(标准操作流程)规则 |
单次对话,命令行交互。适合快速任务和调试。
zeroclaw agent -a aria # 或单次消息 zeroclaw agent -a aria \ --message "summarize today's news"
HTTP/WebSocket 服务器,供外部系统调用。Web 控制台 + API。
zeroclaw gateway start # 默认监听 0.0.0.0:8080 # Dashboard: http://localhost:8080
全自主运行时,多通道 + 调度器 + SOP 同时工作。生产环境首选。
zeroclaw daemon start zeroclaw daemon status zeroclaw daemon stop
将 ZeroClaw 注册为系统服务,开机自启:
# 安装为系统服务(自动适配 systemd / launchd / Windows SCM) zeroclaw service install # 启动服务 zeroclaw service start # 查看状态 zeroclaw service status # 查看日志 zeroclaw service logs --follow # 卸载 zeroclaw service uninstall
# docker-compose.yml(简化示例)
services:
zeroclaw:
image: ghcr.io/zeroclaw-labs/zeroclaw:latest
volumes:
- ~/.zeroclaw:/root/.zeroclaw
ports:
- "8080:8080"
environment:
- ANTHROPIC_API_KEY=${ANTHROPIC_API_KEY}
restart: unless-stopped
docker compose up -d
# 使用仓库内提供的 manifest kubectl apply -f deploy-k8s/ kubectl get pods -n zeroclaw
# 使用 flake nix run github:zeroclaw-labs/zeroclaw # 或加入 NixOS 配置 inputs.zeroclaw.url = "github:zeroclaw-labs/zeroclaw";