OpenClaw 使用手册 🦞
一只住在你设备里的数字龙虾,带你玩转 OpenClaw
目录
注意事项
如果你使用原版的openclaw
使用
openclaw命令
如果使用中文版本的openclaw
使用
openclaw-cn命令
1. 快速开始
1.1 首次安装
# 安装 OpenClaw
npm i -g openclaw
# 初始化配置(推荐)
openclaw onboard
# 启动服务
openclaw gateway start
1.2 访问控制面板
启动后访问:http://127.0.0.1:18789/
1.3 快速命令
| 命令 | 说明 |
|---|---|
openclaw status |
查看状态 |
openclaw gateway start |
启动服务 |
openclaw gateway stop |
停止服务 |
openclaw gateway restart |
重启服务 |
2. 基础命令
2.1 服务管理
# 启动/停止/重启
openclaw gateway start
openclaw gateway stop
openclaw gateway restart
# 查看状态
openclaw status
openclaw health
2.2 消息管理
# 发送消息
openclaw message send --to 用户ID --message "你好"
# 查看会话
openclaw sessions list
openclaw sessions history <session-key>
2.3 日志查看
# 查看日志
openclaw logs
# 实时日志
openclaw logs --follow
3. 技能系统
3.1 什么是技能?
技能(Skills)是赋予 AI 代理工具能力的扩展包。每个技能是一个文件夹,包含:
SKILL.md- 技能说明文档scripts/- 执行脚本_meta.json- 元信息
3.2 技能存放位置
技能从三个地方加载,优先级从高到低:
- 工作区技能:
~/.openclaw/workspace/skills - 托管技能:
~/.openclaw/skills - 捆绑技能:随安装包一起发布
3.3 查看已安装技能
# 列出所有技能
openclaw skills list
# 只显示符合条件的技能
openclaw skills list --eligible
# 查看技能详情
openclaw skills info <技能名>
4. 安装官方技能
4.1 通过 ClawdHub 安装(推荐)
ClawdHub 是 OpenClaw 的公共技能商店,地址:https://clawdhub.com
安装 ClawdHub CLI
npm i -g clawdhub
# 登录(发布技能时需要)
clawdhub login
# 查看已安装技能
clawdhub list
安装技能
# 安装技能(安装到当前目录的 ./skills)
clawdhub install <技能名称>
# 示例:安装 Tavily 搜索
clawdhub install tavily-search
# 安装指定版本
clawdhub install <技能名称> --version 1.2.3
更新技能
# 更新单个技能
clawdhub update <技能名称>
# 更新所有技能
clawdhub update --all
# 强制更新
clawdhub update <技能名称> --force
发布技能
clawdhub publish ./我的技能 --slug 我的技能 --name "我的技能" --version 1.0.0
4.2 手动安装
如果技能发布在 GitHub 或其他地方,可以手动安装:
# 克隆技能仓库
git clone https://github.com/xxx/技能名.git ~/.openclaw/workspace/skills/技能名
4.3 常用技能推荐
| 技能名称 | 说明 | 需要的配置 |
|---|---|---|
| tavily-search | AI 优化的网络搜索 | TAVILY_API_KEY |
| weather | 天气查询 | 无 |
| apple-notes | Apple 笔记管理 | macOS |
| apple-reminders | Apple 提醒事项 | macOS |
| obsidian | Obsidian 笔记 | Obsidian |
| spotify-player | Spotify 控制 | Spotify API |
| github | GitHub 操作 | GitHub CLI |
5. 配置管理
5.1 配置文件位置
主配置文件:~/.openclaw/openclaw.json
5.2 交互式配置
# 打开配置向导
openclaw configure
# 或
openclaw config
5.3 命令行配置
# 查看配置
openclaw config get agents.defaults.model.primary
# 设置配置
openclaw config set channels.telegram.enabled true
# 删除配置
openclaw config unset agents.defaults.model.primary
5.4 常用配置项
{
"gateway": {
"port": 18789,
"mode": "local"
},
"agents": {
"defaults": {
"model": {
"primary": "siliconflow/Pro/MiniMaxAI/MiniMax-M2.5"
}
}
},
"skills": {
"install": {
"nodeManager": "npm"
}
}
}
6. 常用技巧
6.1 设置环境变量
很多技能需要 API Key,可以在配置中设置:
# 方式1:临时设置(运行脚本时)
TAVILY_API_KEY="你的Key" node scripts/search.mjs "查询"
# 方式2:写入 TOOLS.md(推荐用于记录)
# 在 ~/.openclaw/workspace/TOOLS.md 中记录
6.2 使用定时任务
# 添加定时任务
openclaw cron add --name "每日提醒" --schedule "0 9 * * *" --message "早上好!"
# 查看任务
openclaw cron list
# 删除任务
openclaw cron remove <job-id>
6.3 配对移动设备
# 配对新设备
openclaw pairing start
# 查看已配对设备
openclaw nodes list
7. 故障排查
7.1 诊断问题
# 运行诊断
openclaw doctor
# 查看详细日志
openclaw logs --level debug
7.2 常见问题
服务启动失败
# 检查端口占用
lsof -i :18789
# 重置配置
openclaw reset --config
技能无法加载
# 检查技能状态
openclaw skills check
# 查看缺少什么
openclaw skills list --eligible
消息发不出去
# 检查频道配置
openclaw channels list
# 测试连接
openclaw health
7.3 更新 OpenClaw
# 更新到最新版本
openclaw update
# 或
openclawCn update
更多资源
- 官方文档:https://docs.openclaw.ai
- 技能商店:https://clawdhub.com
- GitHub:https://github.com/openclaw/openclaw
- 社区 Discord:https://discord.com/invite/clawd
有问题?随时问我!🦞

评论区