clawstu

OpenClaw 命令速查

实时更新 OpenClaw 最常用命令,方便快速查阅。

一、Gateway 服务管理

# 前台启动(调试用)
openclaw gateway --port 18789

# 后台守护进程启动
openclaw gateway --port 18789 --daemon

# 强制启动(清理占用端口的进程)
openclaw gateway --port 18789 --force

# 安装为系统服务
openclaw gateway install

# 服务状态管理
openclaw gateway status
openclaw gateway restart
openclaw gateway stop
openclaw gateway uninstall

二、Dashboard 管理

# 启动 Dashboard
openclaw dashboard --port 8080

# 指定配置文件
openclaw dashboard --config /etc/openclaw/dashboard.yaml

# 后台运行
openclaw dashboard --daemon

三、Channel 渠道管理

# 添加渠道
openclaw channel add --name "openai-prod" --type openai --key "sk-xxx"

# 列出所有渠道
openclaw channel list

# 查看渠道详情
openclaw channel get --name "openai-prod"

# 更新渠道
openclaw channel update --name "openai-prod" --key "sk-newkey"

# 删除渠道
openclaw channel remove --name "openai-prod"

# 测试渠道连通性
openclaw channel test --name "openai-prod"

# 启用/禁用渠道
openclaw channel enable --name "openai-prod"
openclaw channel disable --name "openai-prod"

四、系统配置

# 查看当前配置
openclaw config show

# 验证配置文件
openclaw config validate --file ./config.yaml

# 生成默认配置
openclaw config init

五、日志与监控

# 查看实时日志
openclaw logs --follow

# 查看指定时间范围日志
openclaw logs --since "1h ago" --until "now"

# 导出日志
openclaw logs export --output /tmp/openclaw-logs.txt

六、版本与更新

# 查看版本
openclaw version

# 检查更新
openclaw update check

# 执行更新
openclaw update apply