CLI commands
`openclaw tasks`
檢查持久背景任務與 Task Flow 狀態。沒有子命令時,
openclaw tasks 等同於 openclaw tasks list。
請參閱背景任務以了解生命週期與交付模型。
使用方式
openclaw tasks
openclaw tasks list
openclaw tasks list --runtime acp
openclaw tasks list --status running
openclaw tasks show <lookup>
openclaw tasks notify <lookup> state_changes
openclaw tasks cancel <lookup>
openclaw tasks audit
openclaw tasks maintenance
openclaw tasks maintenance --apply
openclaw tasks flow list
openclaw tasks flow show <lookup>
openclaw tasks flow cancel <lookup>
根選項
--json:輸出 JSON。--runtime <name>:依種類篩選:subagent、acp、cron或cli。--status <name>:依狀態篩選:queued、running、succeeded、failed、timed_out、cancelled或lost。
子命令
list
openclaw tasks list [--runtime <name>] [--status <name>] [--json]
列出追蹤的背景任務,最新的在前。
show
openclaw tasks show <lookup> [--json]
依任務 ID、執行 ID 或工作階段金鑰顯示單一任務。
notify
openclaw tasks notify <lookup> <done_only|state_changes|silent>
變更執行中任務的通知政策。
cancel
openclaw tasks cancel <lookup>
取消執行中的背景任務。
audit
openclaw tasks audit [--severity <warn|error>] [--code <name>] [--limit <n>] [--json]
顯示過時、遺失、交付失敗或其他不一致的任務與 Task Flow 記錄。保留到 cleanupAfter 的遺失任務是警告;已過期或未加蓋戳記的遺失任務是錯誤。
maintenance
openclaw tasks maintenance [--apply] [--json]
預覽或套用任務與 Task Flow 對帳、清理戳記,以及修剪。
對於 Cron 任務,對帳會先使用已持久保存的執行記錄/工作狀態,再將舊的作用中任務標記為 lost,因此已完成的 Cron 執行不會只因為記憶體內的 Gateway 執行階段狀態消失而變成錯誤的稽核錯誤。離線 CLI 稽核對於 Gateway 的行程本機 Cron 作用中工作集合不具權威性。
flow
openclaw tasks flow list [--status <name>] [--json]
openclaw tasks flow show <lookup> [--json]
openclaw tasks flow cancel <lookup>
檢查或取消任務分類帳下的持久 Task Flow 狀態。