OpenClaw 是本地优先的 AI 执行网关,用自然语言让 AI 直接操作你的设备(文件、终端、浏览器、IM 等) 。下面是完整使用流程。
一、安装(一键脚本,全平台)
Linux/macOS/WSL2
bash
curl -fsSL https://get.openclaw.ai | bash
Windows(管理员 PowerShell)
powershell
irm https://get.openclaw.ai | iex
安装完成后,执行初始化:
bash
openclaw onboard --install-daemon
按提示:
- 确认权限 → 输入 yes
- 网关端口默认 18789 → 回车
- 选择模型(如 Kimi、GLM、GPT)→ 粘贴 API Key
- 渠道/技能新手可跳过 → 完成
二、验证与启动
bash
# 检查配置
openclaw doctor
# 查看状态
openclaw status
# 启动服务
openclaw start
# 重启/停止
openclaw restart / openclaw stop
三、三种交互方式
1. 终端交互(最常用)
bash
openclaw chat
直接输入指令,例如:
- 帮我整理桌面文件,按类型分类
- 把 /data 下所有 .log 压缩成一个 zip
- 打开浏览器访问 openclaw.ai
2. Web 面板
浏览器打开:
plaintext
http://localhost:18789
在聊天框发指令,可视化查看执行过程。
3. IM 机器人(飞书/钉钉/企业微信)
bash
openclaw configure
选择 channels → 对应 IM → 按向导配置机器人,即可在群里 @OpenClaw 发指令。
四、常用指令速查
bash
openclaw chat # 终端聊天
openclaw start/stop # 启停服务
openclaw logs # 查看日志
openclaw skills list # 查看已装技能
openclaw skills install 技能名 # 安装技能
openclaw configure # 重新配置
五、指令写法(让 AI 更听话)
- 明确路径: /Users/xxx/Desktop
- 明确操作: 提取、压缩、重命名、运行脚本
- 明确参数: 输出到 /output,保留原文件
示例:
plaintext
帮我处理视频:
1. 源文件:/video/input.mp4
2. 提取前 10 分钟
3. 加字幕(自动识别)
4. 输出到 /video/output.mp4
六、技能扩展(进阶)
OpenClaw 靠 Skills 扩展能力:
bash
# 安装文件管理技能
openclaw skills install file-manager
# 安装浏览器自动化
openclaw skills install browser
技能市场: https://clawhub.ai
七、常见问题
- 权限不足:Linux/macOS 用 sudo ,Windows 用管理员终端
- 模型连不上:检查 API Key 与网络
- 端口占用: openclaw configure 改端口
夜雨聆风