1. 准备 Node 环境
1
| curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.40.4/install.sh | bash
|
需要修改 Bash 的配置文件,添加以下内容:
1
2
3
| export NVM_DIR="$HOME/.nvm"
[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh"
[ -s "$NVM_DIR/bash_completion" ] && \. "$NVM_DIR/bash_completion"
|
2. 安装 OpenClaw
1
| npm install -g openclaw@latest
|
1
| npm uninstall -g openclaw
|
加上 --install-daemon 参数,重启之后,服务自动启动。openclaw onboard --force 会强制重新初始化配置。
修改 ~/.openclaw/openclaw.json 文件的以下参数:
1
2
3
4
5
6
| {
...
"contextWindow": 262144,
"maxTokens": 65536
...
}
|
重启 gateway 服务配置生效。
1
| openclaw gateway restart
|
3. 使用命令
4. gateway 管理
gateway 是 OpenClaw 的网关模块,主要是需要启动和停止。
1
| openclaw gateway restart
|
5. plugins 管理
plugins 是 OpenClaw 的功能扩展模块,主要是需要安装和启用。
1
| openclaw plugins install telegram
|
1
| openclaw plugins enable telegram
|
1
| openclaw plugins disable telegram
|
6. skills 管理
skills 是 OpenClaw 的技能模块,主要是需要安装和启用。
1
| openclaw skills info weather
|
7. channel 管理
channel 是 OpenClaw 与外部 / 用户交互的通信方式,主要是需要开启和配置。
1
| openclaw channels add --channel telegram --token <token>
|
也可以不加参数,进入交互页面配置 channel 信息。
1
| openclaw channels status
|
1
| openclaw channels logout --channel telegram
|
8. agent 管理
agent 是 OpenClaw 的智能体模块,主要是需要创建和管理。通过 agent 子命令可以创建多个角色的智能体
1
| openclaw agents add test
|
1
| openclaw agents set-identity --agent test --name test2
|
修改 name/theme/emoji/avatar 等
1
| openclaw agents delete test
|
1
| openclaw agent --agent main --message "hello"
|
9. 运维操作
1
| openclaw daemon install
|
1
| openclaw daemon uninstall
|
1
| openclaw uninstall --all --yes --non-interactive
|
10. 异常处理
1
2
| 400 Invalid JSON payload received. Unknown name "patternProperties" at 'tools[0].function_declarations[3].parameters.properties[4].value': Cannot find field.
Invalid JSON payload received. Unknown name "additionalProperties" at 'tools[0].function_declarations[5].parameters.properties[20].value.properties[3].value.items': Cannot find field.
|
模型配置异常,需要更换模型。