TheDocumentation Index
Fetch the complete documentation index at: https://messages.dev/docs/llms.txt
Use this file to discover all available pages before exploring further.
messages-dev CLI is the fastest way to poke at the API by hand, pipe a
shell pipeline into a message, or stream live events into a local dev server.
It is a single self-contained binary built from the same SDK that powers the
TypeScript client.
Install
~/.messages/bin/. It
prints the line you need to add to your shell rc.
Pin a specific release with
MESSAGES_CLI_VERSION=v0.2.0 or change the
install location with MESSAGES_INSTALL=/opt/messages.Authenticate
Two options. Pick the one that fits your context.MESSAGES_API_KEY always wins over the config file. Create a key in the
dashboard under API Keys.
Send your first message
--from is optional. Otherwise pass
--from <handle> to disambiguate.
You can also pipe text in over stdin:
Commands
Runmessages-dev <command> --help for full flag detail on any of these.
| Command | What it does |
|---|---|
login / logout | Sign in interactively; remove stored credentials |
send <to> [text] | Send a text, attachment, or audio message. Reads stdin when [text] is omitted. |
react <msg-id> <emoji> | Send a tapback. love, like, dislike, laugh, emphasize, question, or a literal emoji. |
typing <to> | Send a typing indicator. --off clears it. |
read <to> | Mark a chat as read. |
lines list | List the lines on your account. |
chats list --line <handle> | List chats on a line. |
messages list --line <h> --chat <r> | List messages in a chat. Cursor-paginated. |
messages get <id> --line --chat | Fetch a single message. |
reactions list --message <id> | List reactions on a message. |
receipts list --line --chat | List read receipts in a chat. |
outbox get <id> | Inspect an outbound item by obx_… id. |
files upload <path> | Upload a file, print its file_… id. |
files get <id> | Print a download URL, or stream bytes with --download. |
webhooks list / create / delete | Manage webhook subscriptions. |
listen | Stream events live; with --forward-to, post HMAC-signed webhooks to a local URL. |
Output and exit codes
By default every command renders human-readable output. Pass--json (or set
MESSAGES_OUTPUT=json once for the whole shell) to switch to structured
output on stdout. Errors always go to stderr; with --json they take the
shape {"error":{"code":"…","message":"…"}}.
| Exit code | Meaning |
|---|---|
0 | OK |
1 | Generic failure |
2 | Usage error (bad flags, missing args) |
3 | Not authenticated |
4 | Not found |
5 | Validation error |
Recipes
Pipe stdin into a message
Anything that produces text on stdout can become an iMessage:Forward live events to a local webhook handler
listen --forward-to turns the CLI into a poor-man’s tunnel for webhook
development. It subscribes to your account’s event stream and POSTs each
event to your local URL with the same HMAC headers production webhooks use,
so you can develop and test webhook handlers without ngrok or a tunnel.
MESSAGES_LISTEN_SECRET=….
Filter to specific events or scope to a single line:
Upload an attachment, then send it
jq by upgrading the recipient flow to your code’s needs:
files upload output prints the bare file_… id, suitable for
direct substitution.)
Tapback the latest message in a thread
Troubleshooting
command not found: messages-dev — the install directory is not on your
PATH. Add export PATH="$HOME/.messages/bin:$PATH" to your shell rc, or run
the binary by full path.
macOS blocks the binary on first run — Gatekeeper. See the warning under
Install. The npm-installed CLI does not hit this.
not_authenticated errors — you signed in on a different machine, or
your API key was revoked. MESSAGES_API_KEY takes precedence over
~/.messages/config.json; if you have a stale key exported, the file is
ignored. Run messages-dev login or unset MESSAGES_API_KEY.
Pin or roll back a version — the install script honors
MESSAGES_CLI_VERSION:
See also
TypeScript SDK
The same API as the CLI, in your code.
Webhooks
Long-term event delivery once you outgrow
listen --forward-to.