🦞 OpenClaw 文档中心

完整的OpenClaw安装、配置和使用指南

常用命令

快速命令参考

✅ 提示
所有命令都需要SSH连接到服务器后执行。使用 ssh openclaw 快速连接。

Gateway管理

查看Gateway状态

systemctl status openclaw-gateway

启动Gateway

systemctl start openclaw-gateway

重启Gateway

systemctl restart openclaw-gateway

停止Gateway

systemctl stop openclaw-gateway

查看Gateway日志(实时)

journalctl -u openclaw-gateway -f

查看Gateway日志(最后100行)

journalctl -u openclaw-gateway -n 100

设备管理

列出所有配对的设备

openclaw devices list

输出包含已配对设备和待批准设备。

批准新设备

openclaw devices approve REQUEST_ID

将REQUEST_ID替换为实际的设备请求ID(可从 devices list 输出中获取)。

删除已配对设备

openclaw devices revoke DEVICE_ID

将DEVICE_ID替换为要删除的设备ID。

配置管理

交互式配置向导

openclaw configure

启动配置向导,可以配置模型、通道、技能等。

查看配置文件

cat /root/.openclaw/openclaw.json

编辑配置文件

nano /root/.openclaw/openclaw.json

或使用 vim:vim /root/.openclaw/openclaw.json

备份配置

cp /root/.openclaw/openclaw.json /root/.openclaw/openclaw.json.backup

恢复备份

cp /root/.openclaw/openclaw.json.backup /root/.openclaw/openclaw.json

清除缓存配置

rm -f /root/.openclaw/agents/main/agent/models.json

Web UI和Dashboard

生成Dashboard URL(带token)

openclaw dashboard --no-open

输出会包含一个完整的URL,复制到浏览器访问。

访问Web UI

https://ai.xiachaoqing.com/

第一次访问需要进行设备配对,之后可直接访问。

模型和Agent管理

进入TUI界面(可交互)

openclaw tui

这是一个交互式的终端界面,可以对话、切换模型等。

在TUI中查看模型列表

/model

在TUI界面中输入此命令。

切换模型(临时)

/model bailian/qwen3.5-plus

仅在当前会话有效。

查看所有agents

openclaw agents list

健康检查

openclaw doctor

检查系统状态、配置、权限等。

API Key和认证

获取当前Gateway Token

grep -A2 'auth' /root/.openclaw/openclaw.json | grep token

获取API Key(百炼)

grep -A5 'bailian' /root/.openclaw/openclaw.json | grep apiKey

注意:配置保存后会显示为 __OPENCLAW_REDACTED__ 以保护安全。

日志和监控

查看应用日志

tail -f /tmp/openclaw/openclaw-2026-03-03.log

过滤错误日志

grep ERROR /tmp/openclaw/openclaw-2026-03-03.log

查看系统资源使用

ps aux | grep openclaw

查看内存使用

free -h

查看磁盘使用

df -h

Nginx相关

检查Nginx配置

/www/server/nginx/sbin/nginx -t

重载Nginx

/www/server/nginx/sbin/nginx -s reload

查看Nginx进程

ps aux | grep nginx

查看反向代理配置

cat /www/server/panel/vhost/nginx/39.105.154.244_88.conf

更新和升级

更新OpenClaw

curl -fsSL https://openclaw.ai/install.sh | bash

更新Node.js(使用nvm)

nvm install 22
nvm use 22

查看Node.js版本

node --version
npm --version

重置和清理

重置OpenClaw配置(谨慎!)

openclaw reset

这会删除配置文件。强烈建议先备份!

完全卸载OpenClaw

openclaw uninstall

清理npm缓存

npm cache clean --force