CLI commands
目錄
openclaw directory
針對支援目錄查詢的頻道進行查詢(聯絡人/對等端、群組,以及「我」)。
常用旗標
--channel <name>:頻道 ID/別名(設定多個頻道時為必填;只設定一個頻道時會自動使用)--account <id>:帳號 ID(預設:頻道預設值)--json:輸出 JSON
注意事項
directory旨在協助你找到可貼到其他命令中的 ID(尤其是openclaw message send --target ...)。- 對許多頻道而言,結果是由設定支援(允許清單 / 已設定群組),而不是即時的提供者目錄。
- 已安裝的頻道 Plugin 仍可省略目錄支援;在這種情況下,命令會回報不支援的目錄操作,而不是重新安裝 Plugin。
- 預設輸出是以定位字元分隔的
id(有時也包含name);請使用--json進行指令碼處理。
將結果搭配 message send 使用
openclaw directory peers list --channel slack --query "U0"
openclaw message send --channel slack --target user:U012ABCDEF --message "hello"
ID 格式(依頻道)
- WhatsApp:
+15551234567(私訊)、[email protected](群組)、120363123456789@newsletter(頻道/電子報對外傳送目標) - Telegram:
@username或數字聊天 ID;群組是數字 ID - Slack:
user:U…和channel:C… - Discord:
user:<id>和channel:<id> - Matrix(Plugin):
user:@user:server、room:!roomId:server或#alias:server - Microsoft Teams(Plugin):
user:<id>和conversation:<id> - Zalo(Plugin):使用者 ID(Bot API)
- Zalo Personal /
zalouser(Plugin):來自zca的對話串 ID(私訊/群組)(me、friend list、group list)
自己(「我」)
openclaw directory self --channel zalouser
對等端(聯絡人/使用者)
openclaw directory peers list --channel zalouser
openclaw directory peers list --channel zalouser --query "name"
openclaw directory peers list --channel zalouser --limit 50
群組
openclaw directory groups list --channel zalouser
openclaw directory groups list --channel zalouser --query "work"
openclaw directory groups members --channel zalouser --group-id <id>