一篇文章搞定 OpenClaw
什么是 OpenClaw?
OpenClaw 是开源的 AI 助手框架,让你像钢铁侠的 J.A.R.V.I.S. 一样拥有一个智能助手。
核心特性
- 🤖 多模型支持:GPT、Claude、DeepSeek、GLM 等
- 📱 多渠道接入:Telegram、Discord、微信、飞书等
- ⚡ 自动化任务:心跳机制,24/7 不间断
- 🔧 可扩展:Skills 系统,自定义能力
- 🔐 隐私安全:本地运行,数据不出电脑
快速开始
安装
# macOS/Linux
curl -fsSL https://get.openclaw.ai | bash
# 或 npm
npm install -g openclaw
初始化
openclaw init
配置模型
# ~/.openclaw/config.yaml
model:
default: deepseek-chat
providers:
deepseek:
api_key: ${DEEPSEEK_API_KEY}
启动
openclaw start
测试
openclaw chat "你好"
核心功能
1. 多渠道接入
channels:
- name: telegram-bot
type: telegram
token: ${TG_BOT_TOKEN}
2. 心跳自动化
heartbeat:
enabled: true
interval: 5m
tasks:
- name: daily-report
schedule: "0 18 * * *"
3. Skills 扩展
skills:
- weather
- todo
- github
4. 记忆系统
- 对话历史:自动保存
- 长期记忆:MEMORY.md
- 日志:memory/YYYY-MM-DD.md
进阶配置
多模型切换
model:
default: deepseek-chat
providers:
deepseek:
api_key: xxx
openai:
api_key: yyy
claude:
api_key: zzz
权限控制
permissions:
admin:
- user:admin
user:
- user:*
成本控制
budget:
daily_limit: 100
monthly_limit: 2000
安全配置
security:
sandbox: true
redact:
- api_key
- password
实战案例
个人助理
# 配置
channels:
- telegram
heartbeat:
tasks:
- name: morning-briefing
schedule: "0 8 * * *"
action: python3 briefing.py
客服机器人
channels:
- feishu
knowledge:
sources:
- faq.md
- products.md
auto_reply:
enabled: true
开发助手
skills:
- code-review
- git-helper
- github
channels:
- discord
性能优化
1. 启用缓存
cache:
enabled: true
ttl: 1h
2. 限制历史
memory:
max_turns: 20
3. 选择合适的模型
- 简单任务:DeepSeek / GLM
- 复杂任务:Claude / GPT
- 代码任务:DeepSeek Coder
故障排查
# 检查状态
openclaw status
# 查看日志
openclaw logs --tail 100
# 测试配置
openclaw config check
# 测试模型
openclaw test --model deepseek-chat
常用命令
# 启动/停止
openclaw start
openclaw stop
# 对话
openclaw chat "问题"
# 心跳
openclaw heartbeat status
openclaw heartbeat pause
openclaw heartbeat resume
# Skills
openclaw skill list
openclaw skill test <name>
# 配置
openclaw config check
openclaw config edit
资源链接
- 官网:openclaw.ai
- 文档:docs.openclaw.ai
- GitHub:github.com/openclaw/op…
- 社区:discord.com/invite/claw…
- ClawHub:clawhub.com
中文支持
- 微信:yang1002378395
- 飞书:加入社区群
🎯 这是 OpenClaw 最全指南,收藏备用!
💬 有问题评论区留言,看到必回!