时间:2026-03-23 09:04
人气:
作者:admin
两者命令完全一致,唯一差别只是二进制名称:
openclaw-cn # 中文版
openclaw # 官方版
???? 本文统一使用 openclaw-cn
sudo npm i -g openclaw-cn
# 稳定版
sudo npm i -g openclaw-cn@latest
# 测试版
sudo npm i -g openclaw-cn@beta
# 交互式(推荐)
openclaw-cn onboard
# 快速模式
openclaw-cn onboard --flow quickstart
# 自动化(CI/CD)
openclaw-cn onboard --non-interactive \
--auth-choice token \
--token-provider anthropic \
--token "$TOKEN"
openclaw-cn config get agents.defaults.model.primary
openclaw-cn config get gateway.port
openclaw-cn config set agents.defaults.model.primary "doubao-code"
openclaw-cn config set gateway.port 19001 --json
openclaw-cn config unset tools.web.search.apiKey
???? 核心组件,所有消息/Agent 都依赖它
openclaw-cn gateway run --bind loopback --port 18789
openclaw-cn gateway run --force
nohup openclaw-cn gateway run --bind loopback --port 18789 --force \
> /tmp/clawdbot-gateway.log 2>&1 &
openclaw-cn gateway install
openclaw-cn gateway start
openclaw-cn gateway stop
openclaw-cn gateway restart
openclaw-cn gateway status
openclaw-cn gateway health
openclaw-cn gateway probe
openclaw-cn logs --follow
openclaw-cn logs --limit 200 --json
openclaw-cn models status
openclaw-cn models status --probe
openclaw-cn models list
openclaw-cn models set volcengine/doubao-code
openclaw-cn models auth add
openclaw-cn models auth paste-token
openclaw-cn models scan --set-default
支持:Telegram / Discord / Slack / WhatsApp
openclaw-cn channels add --channel telegram --token "$TOKEN"
openclaw-cn channels status --probe
openclaw-cn channels remove --channel telegram
openclaw-cn agents add work --workspace ~/clawd-work
openclaw-cn agent --message "你好"
openclaw-cn agents set-identity --name "Clawd" --emoji "????"
openclaw-cn message send \
--channel telegram \
--target "123456" \
--message "你好"
openclaw-cn message send --media ./photo.jpg
openclaw-cn doctor
openclaw-cn status --deep
openclaw-cn models status --probe
???? 推荐组合:
openclaw-cn doctor && \
openclaw-cn status --deep && \
openclaw-cn models status --probe
openclaw-cn plugins install <plugin>
openclaw-cn plugins enable <plugin-id>
openclaw-cn plugins disable <plugin-id>
openclaw-cn hooks enable session-memory
openclaw-cn hooks enable command-logger
???? 常用:
| Hook | 作用 |
|---|---|
| session-memory | 自动记忆 |
| boot-md | 启动执行脚本 |
| command-logger | 审计日志 |
# 每天执行
openclaw-cn cron add --every 24h --system-event "生成日报"
# 指定时间
openclaw-cn cron add --at "2026-03-03T09:00:00" --message "开会提醒"
openclaw-cn memory index
openclaw-cn memory search "发布流程"
???? 本质:RAG(向量检索)
openclaw-cn sandbox list
openclaw-cn sandbox recreate --all
???? 用于安全执行代码
openclaw-cn browser open https://example.com
openclaw-cn browser screenshot --full-page
openclaw-cn nodes list
openclaw-cn nodes run --node <id> -- ls -la
???? 类似远程 Agent 执行器
# 更新
openclaw-cn update
# 重置配置
openclaw-cn reset --scope config
# 完全重置
openclaw-cn reset --scope full --yes
openclaw-cn dashboard # Web UI
openclaw-cn tui # 终端 UI
openclaw-cn docs "Telegram"
pkill -9 -f clawdbot-gateway || true
nohup openclaw-cn gateway run \
--bind loopback --port 18789 --force \
> /tmp/clawdbot-gateway.log 2>&1 &
openclaw-cn channels status --probe
ss -ltnp | grep 18789
tail -n 120 /tmp/clawdbot-gateway.log
sudo npm i -g openclaw-cn && openclaw-cn onboard
| 类型 | 路径 |
|---|---|
| 配置文件 | ~/.openclaw/openclaw.json |
| 凭证 | ~/.openclaw/credentials/ |
| 会话 | ~/.openclaw/sessions/ |
| 工作区 | ~/clawd |
| 日志 | /tmp/clawdbot-gateway.log |
OpenClaw CLI 的核心可以抽象为 5 层:
模型(Models)
↓
Agent(智能体)
↓
Gateway(网关)
↓
Channels(渠道)
↓
用户
再叠加:
???? 本质就是一个 本地 AI 操作系统(AI OS)