From 5f8aa0128570073e9853ec04848ab93193865752 Mon Sep 17 00:00:00 2001 From: Peter Jones Date: Tue, 27 Jan 2026 12:32:13 +0000 Subject: [PATCH] feat(cli): add gateway wake command Adds `clawdbot gateway wake` CLI command to send wake events from the terminal. Options: - --text : Wake event text (injected as system event) - --mode : Wake mode: 'now' (immediate) or 'next-heartbeat' This allows external processes (like Claude Code) to wake the agent without needing to go through the agent tool interface. Example: clawdbot gateway wake --text 'Background task finished' --mode now --- src/cli/gateway-cli/register.ts | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/src/cli/gateway-cli/register.ts b/src/cli/gateway-cli/register.ts index eec58dd58..ffab3e4a9 100644 --- a/src/cli/gateway-cli/register.ts +++ b/src/cli/gateway-cli/register.ts @@ -264,6 +264,30 @@ export function registerGatewayCli(program: Command) { }); }); + gatewayCallOpts( + gateway + .command("wake") + .description("Send a wake event to the Gateway (trigger agent processing)") + .option("--text ", "Wake event text (injected as system event)", "Wake event") + .option("--mode ", "Wake mode: now (immediate) or next-heartbeat (default)", "now") + .action(async (opts) => { + await runGatewayCommand(async () => { + const mode = opts.mode === "next-heartbeat" ? "next-heartbeat" : "now"; + const text = String(opts.text || "Wake event"); + const result = await callGatewayCli("wake", opts, { mode, text }); + if (opts.json) { + defaultRuntime.log(JSON.stringify(result, null, 2)); + return; + } + const rich = isRich(); + defaultRuntime.log(colorize(rich, theme.heading, "Gateway Wake")); + defaultRuntime.log( + `${colorize(rich, theme.success, "OK")} · mode: ${mode} · text: "${text}"`, + ); + }, "Gateway wake failed"); + }), + ); + gateway .command("discover") .description(