OpenClaw CLI & Automation

This chapter rounds up OpenClaw's CLI commands, the Dashboard console, and its signature autonomous operation — the Heartbeat, Webhooks, and Cron.


CLI Cheat Sheet

CommandPurpose
openclaw onboard --install-daemonOnboard and install the persistent daemon
openclaw gateway statusShow gateway status
openclaw gateway --port 18789Start the gateway on a port
openclaw dashboardOpen the local web console
openclaw --helpShow the full command list for your version

Commands evolve across versions; defer to openclaw --help and the official repo.


The Dashboard Console

openclaw dashboard
# open in browser
http://127.0.0.1:18789/

The Dashboard lets you chat directly, view sessions, manage channels and skills, adjust tool policies, and more.

The control plane listens on WebSocket :18789. Again: bind local only, never expose it publicly, and keep it updated (see Security).

OpenClaw can also be accessed via the CLI, a macOS desktop app, and iOS/Android nodes.


Heartbeat: Autonomous Operation

This is OpenClaw's signature capability. The Heartbeat scheduler "wakes" the agent at a configurable interval so it can work on its own without you prompting.

heartbeat fires (default every 30 min)
   → agent reads the workspace's HEARTBEAT.md checklist
   → decides "is there anything to do right now?"
   → if yes: perform the task and report
     if no:  respond HEARTBEAT_OK (do nothing)
  • Default interval ~30 minutes; with Anthropic OAuth it's roughly hourly
  • HEARTBEAT.md is the "recurring checklist" you write for the agent

A HEARTBEAT.md Example

# Check on each heartbeat
- Any new high-priority email? If so, summarize and remind me
- Any new PRs awaiting review in my GitHub repo? If so, notify me
- Is it 8 AM? If so, push today's to-dos
# If none of the above need action, respond HEARTBEAT_OK

Other Triggers: Webhooks & Cron

Beyond the heartbeat, OpenClaw's agent loop can be invoked by external events:

TriggerScenario
HeartbeatPeriodic self-checks and routine tasks
WebhookExternal events (CI finished, form submitted) trigger in real time
CronPrecise scheduled tasks (e.g., generate a daily report at 9:00)
Teammate messagesA message on a chat platform triggers the agent
Webhook (event arrived) ─┐
Cron (time's up)        ─┼─→ agent loop → execute → report via chat platform
Heartbeat               ─┘

Balancing Cost and Frequency

Autonomy is powerful, but more frequent heartbeats and pricier models grow the bill faster:

short interval + expensive model → bill spikes (thousands/month in extreme cases)
sensible interval + hybrid models + fallback chain → cost stays controlled

Recommendations:

  • Set the heartbeat interval to what tasks actually need — don't crank it too short
  • Use cheap/local models for routine light tasks, falling back to a strong model when complex (see Model Configuration)
  • Set spending alerts at the provider level to catch abnormal growth early

Practical Tips

  • Keep HEARTBEAT.md short and focused — list only what truly needs watching
  • Use Webhooks for real-time triggers, Cron for fixed times, Heartbeat for routine self-checks
  • Autonomous tasks are still bound by tool policies — high-risk actions still need approval, so it can't cause trouble unattended
  • Before going autonomous, manually walk through the whole flow in the Dashboard

Next Steps