在仓库页面点击右上角的 "云原生开发" 按钮,即可一键创建 OpenClaw 开发环境。
系统将自动完成以下步骤:
进入开发环境后,使用以下命令:
# 运行配置向导(首次使用)
openclaw onboard --install-daemon
# 启动 Gateway
openclaw gateway --port 18789
# 打开浏览器控制面板
openclaw dashboard
如需自定义配置,可在 .cnb.yml 中添加:
stages:
- name: 设置环境变量
script: |
export OPENCLAW_HOME=/custom/path
export OPENCLAW_STATE_DIR=/custom/state
export OPENCLAW_CONFIG_PATH=/custom/config/openclaw.json
# 发送测试消息(需配置频道)
openclaw message send --target +15555550123 --message "Hello from OpenClaw"
# 检查配置
openclaw doctor
# 检查 Gateway 状态
openclaw gateway status
# 检查版本
openclaw --version
# 查看 Gateway 日志
openclaw gateway logs
OpenClaw 配置文件位于 ~/.openclaw/openclaw.json
示例配置:
{
"channels": {
"whatsapp": {
"allowFrom": ["+15555550123"],
"groups": {
"*": { "requireMention": true }
}
}
},
"messages": {
"groupChat": {
"mentionPatterns": ["@openclaw"]
}
}
}
# 重新安装
curl -fsSL https://openclaw.ai/install.sh | bash
# 检查 PATH
echo $PATH
# 检查端口占用
lsof -i :18789
# 检查配置
openclaw doctor
# 查看详细日志
openclaw gateway --port 18789 --verbose