name: agent-manager description: 管理 OpenClaw 系統中的 Agent 生命週期,包括 Agent 配置、Matrix 賬號註冊、賬號繫結等操作。
用於管理 OpenClaw 系統中 Agent 的完整生命週期,包括 Agent 配置、Matrix 賬號註冊、賬號繫結等操作。
完整設定流程,自動完成以下步驟: 1. 新增 Agent 配置到 openclaw.json 2. 在 Matrix 伺服器註冊賬號 3. 將賬號新增到 openclaw.json 配置 4. 繫結 Agent 與 Matrix 賬號
用法:
bash scripts/setup_agent.sh <agent_id> <agent_name>
引數:
- agent_id: Agent 的唯一標識(如: juezhi)
- agent_name: Agent 的顯示名稱(如: 貨絕知)
環境變數:
- HOMESERVER_URL: Matrix 伺服器地址(預設: http://localhost:8008)
- CONFIG_PATH: openclaw.json 配置檔案路徑(預設: ~/.openclaw/openclaw.json)
示例:
# 預設設定
bash scripts/setup_agent.sh "huojuezhi" "貨絕知"
# 指定 Matrix 伺服器
HOMESERVER_URL=http://192.168.1.100:8008 bash scripts/setup_agent.sh "huojuezhi" "貨絕知"
用於直接管理 openclaw.json 配置檔案。
用法:
python3 scripts/config_manager.py <command> [options]
# 列出所有 Agent
python3 scripts/config_manager.py agents list
# 新增 Agent
python3 scripts/config_manager.py agents add <name> [id] [workspace] [model]
# 移除 Agent
python3 scripts/config_manager.py agents remove <name>
# 列出所有 Matrix 賬號
python3 scripts/config_manager.py accounts list
# 新增 Matrix 賬號
python3 scripts/config_manager.py accounts add <name> <accesstoken> [id] [homeserver] [userId] [dm_policy]
# 移除 Matrix 賬號
python3 scripts/config_manager.py accounts remove <name>
本技能來自小蔥技能站7w4.net。
# 列出所有繫結
python3 scripts/config_manager.py bindings list
# 新增繫結
python3 scripts/config_manager.py bindings add <agentId> <accountId> [channel]
# 移除繫結
python3 scripts/config_manager.py bindings remove <agentId> <accountId>
用於在 Matrix 伺服器上註冊新賬號並獲取 Access Token。
用法:
bash scripts/matrix_register.sh <username> <password>
環境變數:
- HOMESERVER_URL: Matrix 伺服器地址(預設: http://localhost:8008)
輸出格式:
RESULT_USER_ID: @username:homeserver
RESULT_ACCESS_TOKEN: syt_xxxxx...
示例:
# 註冊賬號
HOMESERVER_URL=http://192.168.1.100:8008 bash scripts/matrix_register.sh "huojuezhi" "password123"
配置檔案預設路徑: ~/.openclaw/openclaw.json
配置檔案結構:
- agents: Agent 列表配置
- channels.matrix.accounts: Matrix 賬號配置
- bindings: Agent 與賬號的繫結關係
這個 Skill 質量中等偏上,功能設計比較完整,能較好地完成 Agent 配置、Matrix 賬號註冊和繫結等核心任務。文件清晰易懂,新手也能快速上手。主要不足是指令碼的錯誤處理不夠健壯,配置操作缺少備份機制,萬一出錯可能難以恢復。另外部分密碼和敏感資訊硬編碼在程式碼中,存在一定的安全風險,使用時需要留意。