Skip to main content

Get started

1

Install the CLI

2

Run setup

Signs you in, asks for a mailbox name, and lets you pick a usage mode (see below). Pass --api-key om_... to skip the browser.
3

Verify

Your agent can now send and receive email.

Usage modes

During setup you choose how the agent handles inbound email. Pass --mode to skip the prompt. notify and channel install a WebSocket bridge that pushes new email to the agent in real time. tool skips the bridge entirely.

Installed files

openmail setup writes three files into ~/.openclaw (override with OPENCLAW_HOME). Together they give the agent credentials, instructions, and config.

1. skills/openmail/SKILL.md

The skill file is the main instruction set the agent reads. Full contents:

2. openmail.env

Credentials and inbox metadata, loaded by the OpenClaw runtime automatically.
Setup stores the key you authenticated with, which is normally your account-wide key. That key reaches every inbox on your account, and it stays on the agent’s machine for as long as the agent runs.Once setup has created the inbox, narrow the stored key to that inbox alone. Mint an inbox-scoped key against the OPENMAIL_INBOX_ID setup wrote, then replace OPENMAIL_API_KEY with it:
The CLI works unchanged on an inbox-scoped key — it resolves and sends from that one inbox. Minting requires your account-wide key, so run this from your own shell, not the agent’s.

3. openclaw.json (merged)

Setup merges OpenMail into the existing openclaw.json. The relevant sections:
The skills.entries.openmail block registers the skill and injects env vars. The hooks.mappings entry routes inbound email notifications from the WebSocket bridge to the agent.

WebSocket bridge

When usage mode is notify or channel, setup also starts a WebSocket bridge that delivers inbound email to the OpenClaw hook endpoint — no public URL needed. If no service manager is available, setup runs the bridge as a background process or prints a manual command. For protocol details, see WebSockets and the WebSocket quickstart.