使用 OpenClaw agent 指令:快速執行與自動化代理任務
開發過程中,最煩人的就是要在不同的介面跳來跳去。如果你想直接從終端機觸發 Agent 任務,或是快速測試某個自動化流程,手動操作 API 實在太慢了。
這時候 openclaw agent 就派上用場了,它讓你直接在命令列就能跟 Agent 互動,省去那些繁瑣的設定步驟。
透過 Gateway 執行 Agent 回合(如果是嵌入式模式,請使用 --local)。你可以使用 --agent <id> 來直接指定特定的 Agent。
相關連結:
- Agent send 工具:Agent send
openclaw agent --to +15555550123 --message "status update" --deliveropenclaw agent --agent ops --message "Summarize logs"openclaw agent --session-id 1234 --message "Summarize inbox" --thinking mediumopenclaw agent --agent ops --message "Generate report" --deliver --reply-channel slack --reply-to "#reports"- 當這個指令觸發
models.json重新生成時,由 SecretRef 管理的 Provider 憑證會以非機密標記(例如環境變數名稱、secretref-env:ENV_VAR_NAME或secretref-managed)的形式保存,而不是解析後的明文。 - 標記的寫入是以來源為準:OpenClaw 會從當前的來源配置快照中保存標記,而不是使用執行時解析出的秘密數值。
如果你在設定過程中遇到任何問題,可以詢問我們的 AI Setup Assistant。
- 了解如何使用 Agent send 傳送訊息
- 查看 Gateway 的運作原理
OpenClaw Expert
還是卡住了?
如果這篇文件沒有解決你的情境,直接問 OpenClaw Expert,拿到可執行步驟。