← 返回
开发者工具 Key 中文

agent-wake

Wake an OpenClaw agent session from an external script or process. Use when a background task (Claude Code CLI, cron job, webhook, price alert, or any script...
从外部脚本或进程唤醒 OpenClaw 代理会话。用于后台任务(Claude Code CLI、cron 作业、Webhook、价格提醒或任何脚本……
krisco65
开发者工具 clawhub v1.0.1 1 版本 100000 Key: 需要
★ 0
Stars
📥 722
下载
💾 10
安装
1
版本
#latest

概述

agent-wake

Wake your OpenClaw agent from any external process using the gateway HTTP API.

How it works

scripts/agent-wake.py calls POST /tools/invoke with the cron tool, firing a wake event into the agent's session. The agent receives the event text as a system message and responds immediately in the correct channel.

Quick start

python agent-wake.py "Task finished -- brief summary" "YOUR_DISCORD_CHANNEL_ID"

Setup (one-time)

See references/setup.md for:

  • Enabling the cron tool over HTTP (required -- blocked by default)
  • Setting GATEWAY_TOKEN
  • Finding your Discord channel ID

Usage patterns

End of a Claude Code CLI task

Add to the task prompt:

When done, run: python "/path/to/agent-wake.py" "Task done -- summary here" "CHANNEL_ID"

From any Python script

import subprocess
subprocess.run([
    "python", "/path/to/agent-wake.py",
    "Price alert triggered -- AAPL crossed $200",
    "1475232925724315740"
])

Standalone (wake main session)

python agent-wake.py "Backup completed successfully"

Omit channel ID to wake the main session (response goes to default channel).

What the agent receives

The event text is injected as a system message. Be specific -- the agent acts on what you write:

Build finished -- 3 errors fixed, tests passing. Send your response to Discord channel 1475232925724315740...

Script location

scripts/agent-wake.py -- copy this wherever your tasks run. No dependencies beyond Python stdlib.

版本历史

共 1 个版本

  • v1.0.1 当前
    2026-03-30 03:01 安全 安全

安全检测

腾讯云安全 (Keen)

安全,无风险
查看报告

腾讯云安全 (Sanbu)

安全,无风险
查看报告

🔗 相关推荐

developer-tools

Gog

steipete
Google Workspace 命令行工具,支持 Gmail、日历、云端硬盘、通讯录、表格和文档。
★ 920 📥 185,720
developer-tools

Github

steipete
使用 `gh` CLI 与 GitHub 交互,通过 `gh issue`、`gh pr`、`gh run` 和 `gh api` 管理议题、PR、CI 运行及高级查询。
★ 666 📥 323,767
developer-tools

CodeConductor.ai

larsonreever
AI驱动平台,提供快速全栈开发、智能体、工作流自动化及低代码AI集成的可扩展产品创建。
★ 65 📥 179,806