OpenClaw 高级使用经验 - 五分钟打造多 Agent 协作编程团队
约 1 分钟
OpenClaw 核心能力
OpenClaw 是一款基于开源架构的 AI 智能体平台,被誉为 2026 年最具突破性的 AI Agent 系统:
- 多模型调度:支持 Anthropic、OpenAI、Google 等主流 AI 模型的自动容灾切换
- 智能记忆检索:通过 Embedding 模型实现混合搜索
- 多 Agent 协作:支持线性流水线、依赖图并行、多 Agent 辩论三种协作模式
- 跨端能力:支持云端与本地设备通过 SSH 反向隧道配对
模型容灾机制配置
文件路径:~/.openclaw/openclaw.json
{
"agents": {
"defaults": {
"model": {
"primary": "anthropic/claude-opus-4-6",
"fallbacks": [
"openai-codex/gpt-5.3-codex",
"google-antigravity/claude-opus-4-6-thinking"
]
}
}
}
}多认证 Profile + Token 轮换
{
"auth": {
"profiles": {
"openai-codex:default": {
"provider": "openai-codex",
"mode": "oauth"
},
"anthropic:default": {
"provider": "anthropic",
"mode": "token"
},
"google-antigravity:mail1@gmail.com": {
"provider": "google-antigravity",
"mode": "oauth",
"email": "mail1@gmail.com"
}
}
}
}Memory Search 配置
{
"agents": {
"defaults": {
"memorySearch": {
"sources": ["memory", "sessions"],
"provider": "gemini",
"model": "gemini-embedding-001",
"query": {
"hybrid": {
"enabled": true,
"vectorWeight": 0.7,
"textWeight": 0.3
}
}
}
}
}
}云端 OpenClaw 与本地 macOS 配对
架构
┌─────────────────────────┐ SSH 反向隧道 ┌─────────────────────────┐
│ 云端 AWS (Ubuntu) │ ◄─────────────────── │ 本地 macOS (MacBook) │
│ │ 端口 18790 │ │
│ OpenClaw Gateway │ │ OpenClaw Node │
│ 监听: 127.0.0.1:18789│ │ 连接: localhost:18790 │
│ 公网 IP: xx.xx.xx.xx │ │ NAT 内网(无公网 IP) │
└─────────────────────────┘ └─────────────────────────┘步骤
- Mac 安装 OpenClaw:
npm install -g openclaw - 获取 Gateway Token: 在 AWS 上查看配置文件
- 建立 SSH 反向隧道:
ssh -N -L 18790:127.0.0.1:18789 ubuntu@<AWS公网IP> - 启动 Node 服务:
OPENCLAW_GATEWAY_TOKEN="<你的Gateway Token>" \ openclaw node run \ --host 127.0.0.1 \ --port 18790 \ --display-name "Master-Mac" - AWS 端批准配对:
openclaw node approve <node-id> - 配置执行权限:
openclaw node exec-approvals set defaults.security full
相关资源
- Team Tasks Skill: https://github.com/win4r/team-tasks