Files
KingClawArmy/docs/guides/guide_openclaw_config.md
Chris 865261acf2 docs: 新增花名冊、更新進度與設定參考
- 新增 agent_roster.md:全體 Agent 花名冊(職稱、代號、模型、指揮鏈、資訊流)
- INDEX.md:Phase 1/2 標為完成,加入花名冊連結
- guide_openclaw_config.md:更新 Channel ID、版本、Agent 總數

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-09 14:47:36 +00:00

188 lines
3.3 KiB
Markdown
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
# OpenClaw 實際設定指南
> 適用版本OpenClaw v2026.4.x
> 更新日期2026-04-09
---
## openclaw.json 結構
設定檔位置:`~/.openclaw/openclaw.json`
```json
{
"agents": {
"defaults": {
"workspace": "~/.openclaw/workspace",
"model": { "primary": "openai-codex/gpt-5.4-mini" }
},
"list": [
{
"id": "main"
},
{
"id": "ceo_coo",
"name": "ceo_coo",
"workspace": "~/.openclaw/workspaces/ceo_coo",
"agentDir": "~/.openclaw/agents/ceo_coo/agent",
"model": "openai-codex/gpt-5.4"
}
]
},
"channels": {
"discord": {
"enabled": true,
"token": "<BOT_TOKEN>",
"guilds": {
"<GUILD_ID>": {
"channels": {
"<CHANNEL_ID>": {}
}
}
}
}
},
"bindings": [
{
"type": "route",
"agentId": "ceo_coo",
"match": {
"channel": "discord",
"peer": {
"kind": "channel",
"id": "<CHANNEL_ID>"
}
}
}
]
}
```
---
## 新增 Agent
```bash
openclaw agents add <agent_id> \
--workspace ~/.openclaw/workspaces/<agent_id> \
--model <model_id> \
--non-interactive
```
---
## Discord 設定
### 1. 接入 Discord Bot
```bash
openclaw channels add --channel discord --token <BOT_TOKEN>
```
### 2. Discord Developer Portal 必開設定
Bot → Privileged Gateway Intents
- Message Content Intent ✅
- Server Members Intent ✅
### 3. 設定 Guild 頻道白名單
`openclaw.json``channels.discord.guilds` 下新增:
```json
"guilds": {
"<GUILD_ID>": {
"channels": {
"<CHANNEL_ID>": {}
}
}
}
```
### 4. 設定 Agent 路由 Binding
```json
"bindings": [
{
"type": "route",
"agentId": "<agent_id>",
"match": {
"channel": "discord",
"peer": {
"kind": "channel",
"id": "<CHANNEL_ID>"
}
}
}
]
```
### 5. 授權 Discord 用戶
Bot 初次收到 DM 時會顯示 pairing code
```bash
openclaw pairing approve discord <PAIRING_CODE>
```
---
## Gateway 管理
Gateway 以 systemd user service 常駐:
```bash
# 啟動
systemctl --user start openclaw-gateway.service
# 重啟
systemctl --user restart openclaw-gateway.service
# 狀態
systemctl --user status openclaw-gateway.service
# 查 log
journalctl --user -u openclaw-gateway.service -f
```
設定異動通常不需重啟(熱重載)。
以下異動需要重啟Discord token、Channel 設定、Plugin 設定。
---
## 常用指令
```bash
# 查 agent 清單與路由
openclaw agents list --json
# 查 channel 連線狀態
openclaw channels status --probe
# 查 binding 清單
openclaw agents bindings
# 設定 agent 路由
openclaw agents bind --agent <id> --bind "discord:<channel_id>"
# 移除 binding
openclaw agents unbind --agent <id> --all
```
---
## King Claw 實際設定
| 項目 | 值 |
|---|---|
| OpenClaw 版本 | v2026.4.9npm 安裝)|
| Guild ID | `1486353934594342924` |
| #總機 Channel ID | `1486735695124107304` |
| 執行長 Agent ID | `ceo_coo` |
| 執行長模型 | `openai-codex/gpt-5.4` |
| 預設模型 | `openai-codex/gpt-5.4-mini` |
| Agent 總數 | 10管理 3 + 量化 7|
| Gateway | systemd user service, port 18789 |
完整花名冊見 [agent_roster.md](../agent_roster.md)。