OpenClaw DMXAPI 一键配置工具
纯 Go 终端 TUI 工具,零 CGO,支持 5 平台一键交叉编译
OpenClaw Config 是一个简洁易用的终端配置工具,帮助用户快速配置 OpenClaw 的 DMXAPI 设置,无需手动编辑配置文件。
使用本工具前,请确保已安装 OpenClaw。本工具会修改 OpenClaw 的配置文件,并在配置完成后自动重启 openclaw 网关。
前往 Releases 页面下载对应平台的版本:
| 平台 | 架构 | 文件 |
|---|---|---|
| Linux | x64 | openclaw-config-linux-amd64 |
| Linux | ARM64 | openclaw-config-linux-arm64 |
| Windows | x64 | openclaw-config-windows-amd64.exe |
| macOS | Intel | openclaw-config-macos-amd64 |
| macOS | Apple Silicon | openclaw-config-macos-arm64 |
# x64
chmod +x openclaw-config-linux-amd64
./openclaw-config-linux-amd64
# ARM64
chmod +x openclaw-config-linux-arm64
./openclaw-config-linux-arm64
# Intel
chmod +x openclaw-config-macos-amd64
./openclaw-config-macos-amd64
# Apple Silicon
chmod +x openclaw-config-macos-arm64
./openclaw-config-macos-arm64
注意:首次运行时 macOS 可能提示"无法验证开发者"。解决方法:
方法一:右键点击文件 → 选择"打开" → 在弹出对话框中再次点击"打开"
方法二:在终端执行以下命令清除隔离标记,然后再运行:
xattr -rd com.apple.quarantine ./openclaw-config-macos-arm64
在文件所在目录按住 Shift 并右键,选择"在此处打开 PowerShell 窗口",然后执行:
.\openclaw-config-windows-amd64.exe
./openclaw-config-<平台> --version
# 例:./openclaw-config-macos-arm64 --version
启动工具后,按顺序填写以下字段:
| 字段 | 说明 |
|---|---|
| Base URL | DMXAPI 的 API 接入地址,默认为 https://www.dmxapi.cn/v1,通常无需修改 |
| API Key | 在 dmxapi.cn 申请的 API 密钥,格式为 sk-... |
| 模型 | 从预设列表中选择,或选择"自定义模型..."后输入模型名称 |
配置保存后,工具会自动执行网关重启,使配置立即生效。
仅当工具提示重启失败时(如 openclaw 未安装或未在 PATH 中),才需要手动执行:
# 仅在工具提示重启失败时才需要手动执行:
openclaw gateway restart
| 命令 | 说明 |
|---|---|
openclaw gateway restart | 重启网关使配置生效 |
/model | 在聊天中查看/切换模型 |
openclaw models list | 列出所有可用模型 |
openclaw-cn tui | 打开终端聊天助手 |
配置保存在以下文件中,可手动查看或备份:
~/.openclaw/openclaw.json~/.openclaw/agents/main/agent/auth-profiles.json~/.openclaw/agents/main/agent/models.jsongit clone https://github.com/YeSongYun/openclaw_config.git
cd openclaw_config
go run .
# 构建当前平台
go build -o openclaw-config .
# 交叉编译(5 平台)
GOOS=linux GOARCH=amd64 CGO_ENABLED=0 go build -o dist/openclaw-config-linux-amd64 .
GOOS=linux GOARCH=arm64 CGO_ENABLED=0 go build -o dist/openclaw-config-linux-arm64 .
GOOS=windows GOARCH=amd64 CGO_ENABLED=0 go build -o dist/openclaw-config-windows-amd64.exe .
GOOS=darwin GOARCH=amd64 CGO_ENABLED=0 go build -o dist/openclaw-config-macos-amd64 .
GOOS=darwin GOARCH=arm64 CGO_ENABLED=0 go build -o dist/openclaw-config-macos-arm64 .
openclaw_config/ ├── app.go # TUI 表单逻辑 ├── main.go # 程序入口(参数解析) ├── internal/ │ ├── config/ │ │ ├── manager.go # 配置管理器 │ │ └── types.go # 配置类型定义 │ └── models/ │ └── presets.go # 预设模型列表 ├── .github/workflows/ # GitHub Actions CI/CD └── .cnb.yml # CNB 云原生构建配置
项目配置了自动化构建和发布:
yesongyun - yesongyun@foxmail.com
MIT