Automation
Create terminals on a schedule, inject prompts into existing sessions, run sequential workflows, or deliver messages through webhooks. Inspect rules and execution history in the UI.
Choose the right mechanism
- Create a new terminal and send its initial task at a chosen time: scheduled terminal creation.
- Send a message to an existing terminal on a timer or after idle: keep-alive.
- Run ordered steps in an existing managed agent: a workflow.
- Deliver one external message to a fixed tab: a webhook.
- Queue work with query, edit, and cancel controls: the 1.24 dispatch queue; see the CLI guide for supported modes.
These services need the desktop app running; they do not promise to wake your computer or run as a hosted service. The 1.23/1.24 broker preserves terminal processes, not schedules or dispatch after app quit. Test in a disposable workspace, then inspect both history and actual output.
CLI and dispatch queueScheduled terminal creation
- Open Settings > Automation and create a rule.
- Set the workspace (or unbound HOME), startup command, and inline prompt or live Prompt Library reference.
- Choose a five-field cron expression in the computer’s local timezone or a one-time date and time.
- Optionally add a precheck command, inspect the next-run time, enable the schedule, and save. Use Run now to check it and inspect execution history.
Automation opens a new foreground terminal and sends its prompt after readiness checks. Failed prechecks skip that run and record the reason. Live prompt references resolve at run time in the selected workspace; prompt variables are unsupported. Sign-in, project-trust, and permission prompts still require your answer in the terminal.
Stopping tracking leaves the terminal open and prevents further automation input. Schedules need the desktop app running; they are not a hosted scheduler.
Keep-alive for existing sessions
Keep-alive injects a message into an existing session. Interval, idle, daily, and once schedules are available through the HTTP API. Idle mode waits for a local agent to be quiet for the configured threshold. One-shot input removes its rule after delivery.
The CLI exposes list, set, and rm for interval, idle, and daily rules. Use the HTTP API for a live Prompt Library reference, resolved on each trigger. Every trigger outcome is recorded in run history, including skipped slots.
Replace <id> and <rule-id> below. CLI installation is currently macOS-only; use the HTTP API reference for configured API clients.
termdock session keepalive set <id> --message "continue the review" --idle 15m --json
termdock session keepalive list <id> --json
termdock session keepalive rm <id> <rule-id> --jsonKeep-alive APIWorkflows
Use the Workflows panel to create a sequence of named prompt steps and select an eligible existing agent terminal. Each step sends a prompt and waits for the agent’s turn to finish before advancing. Inline prompts and Prompt Library references are supported.
Permission prompts pause the workflow for you to answer. Each step has a timeout; inspect paused or timed-out runs before choosing how to continue. Workflows can be bound to an existing target with interval or daily schedules. This differs from cron automation that creates a new terminal.
Webhooks
- In Settings > Automation > Webhooks, choose a local workspace and an existing tab name.
- Create the webhook and copy its URL immediately. The secret URL is shown only once.
- POST a JSON body containing exactly message and submit. The target must be an agent waiting for input.
- Revoke the URL in Settings when no longer needed.
curl -X POST "$WEBHOOK_URL" \
-H "Content-Type: application/json" \
-d '{"message":"Review the new build result","submit":true}'submit: false types without Enter; submit: true also sends Enter. Busy, missing, ambiguous, or unreadable targets reject the request without creating a session or queuing input. This URL can deliver only to its saved workspace and tab name, and does not grant general Terminal API access.
For an external sender, use your own HTTPS tunnel or reverse proxy and expose only /api/webhooks/.... Treat the URL as a password; never expose the rest of the local Terminal API.
Webhook parameters and responsesVerify results and understand restarts
- Run now does not consume a future scheduled slot. Confirm the workspace, next-run time, and the computer’s local timezone.
- Workflows need an existing foreground terminal associated with a managed agent. Manually launching a CLI in an arbitrary shell does not guarantee an eligible workflow target.
- An app restart does not replay unfinished workflow steps. Inspect interrupted-by-restart, skipped, or failed history before deciding how to continue.
- Permission, sign-in, and trust prompts still require a person. Timeouts do not automatically retry or approve.
- A finished turn only informs whether the next step can proceed; it does not prove the output is correct. Check files, tests, and each step’s result.