260310-openclaw部署和使用

必需环境

  • Node.js ≥ 22.0.0

  • npm ≥ 10.0.0(或 pnpm ≥ 8.0.0)

安装NodeJs

1

配置npm 或者 pnpm 仓库源

1
2
3
4
5
# 如果还没有安装 pnpm
npm install -g pnpm

# 安装 OpenClaw
pnpm add -g openclaw@latest

安装openclaw

1
2
3
npm install -g openclaw@latest

openclaw --version

启动配置向导

1
2
3
4
openclaw onboard --install-daemon

# 启动 Gateway 控制平面
openclaw gateway --port 18789 --verbose

在终端执行以下命令:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
openclaw onboard --install-daemon

? 选择 AI 模型供应商:
❯ MiniMax M2.5(CN) - 国内可用,中文支持好
Kimi - 月之暗面,长文本处理强
DeepSeek - 推理能力强,代码能力出色
Claude - Anthropic 出品(需国际网络)
OpenAI GPT - 经典选择(需国际网络)
Gemini - Google 出品(需国际网络)
Ollama - 本地模型,完全离线


? 输入 API Key: [粘贴你的 API Key]
✓ 正在验证 API Key...
✓ 认证成功!


? 是否现在配置 Channel(渠道)?
❯ 跳过,稍后配置

? 是否现在安装 Skills(技能)?
❯ 跳过,稍后安装

? 是否现在配置 Hooks(钩子)?
❯ 跳过,稍后配置

常用命令

管理命令

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
# 打开 Web Dashboard
openclaw dashboard

# 启动 Gateway 控制平面
openclaw gateway --port 18789 --verbose

# 查看运行状态
openclaw status

# 查看日志
openclaw logs

# 运行诊断工具
openclaw doctor

# 停止所有服务
openclaw stop

Agent 命令

1
2
3
4
5
6
7
8
9
10
11
12
13
14
# 与助手对话
openclaw agent --message "你好" --thinking high

# 发送消息到指定渠道
openclaw message send --to +1234567890 --message "Hello from OpenClaw"

# 列出所有 Agent
openclaw agents list

# 添加新 Agent
openclaw agents add <agent-name>

# 编辑 Agent 配置
openclaw agents edit <agent-name>

Channel 命令

1
2
3
4
5
6
7
8
9
10
11
# 列出所有渠道
openclaw channels list

# 添加新渠道
openclaw channels add

# 删除渠道
openclaw channels remove <channel-name>

# 重启渠道
openclaw channels restart <channel-name>

Skill 命令

1
2
3
4
5
6
7
8
9
10
11
# 列出已安装的技能
openclaw skills list

# 搜索技能(需要先安装 clawhub)
clawhub search <关键词>

# 安装技能
clawhub install <skill-name>

# 卸载技能
openclaw skills uninstall <skill-name>

Plugin 命令

1
2
3
4
5
6
7
8
# 列出所有插件
openclaw plugins list

# 启用插件
openclaw plugins enable <plugin-name>

# 禁用插件
openclaw plugins disable <plugin-name>

更新命令

1
2
3
4
5
6
7
# 更新到最新稳定版
openclaw update

# 切换版本通道
openclaw update --channel stable # 稳定版
openclaw update --channel beta # 测试版
openclaw update --channel dev # 开发版