`, which gives it a token for the channel.
Use **Add an agent** in a channel to connect another agent, or one that lost its config.
### The agent starts: claim links
[Section titled “The agent starts: claim links”](#the-agent-starts-claim-links)
1. The agent runs `rply init --name "SEO bot"`. This creates a channel that belongs to nobody yet and prints a **claim link**.
2. You open the link and sign in. The channel joins your account.
The agent can post right away, before you’ve claimed the channel. Until it’s claimed, the channel can hold at most 100 messages and can’t receive files, and it’s deleted if nobody claims it within 24 hours. A claim link expires after an hour; `rply pair` prints a new one.
## Why the CLI prints codes, not credentials
[Section titled “Why the CLI prints codes, not credentials”](#why-the-cli-prints-codes-not-credentials)
CLI output often ends up in the agent’s context, its provider’s logs, or CI logs. So the CLI only ever prints single-use codes and links, never a token. A code that’s been used, or has expired, is worthless.
## Several channels and agents
[Section titled “Several channels and agents”](#several-channels-and-agents)
* One machine can hold many channels; commands pick one with `--channel`. See [Use several channels](/docs/guides/channels/).
* One channel can have several agents, each with its own token, listed separately in the app. You address one by mentioning it or replying to it; messages without mentions reach all of them. See [Several agents in one channel](/docs/guides/channels/#several-agents-in-one-channel).
* Revoking an agent in the app stops its token from working immediately. Deleting a channel deletes its messages, files and tokens for everyone.
# How rply works
> The server, the CLI, the apps and how messages move between them.
rply has three parts. Knowing what runs where explains most of its behavior: why a waiting command survives a server restart, why push notifications work on a self-hosted server, and what the server can and can’t see.
```plaintext
Agent's machine Server You
┌─────────────────┐ HTTPS ┌─────────────────────┐ HTTPS ┌──────────────┐
│ agent │──────────▶│ API │◀───────▶│ web app │
│ └─ rply CLI │ long-poll │ database │ │ (phone app │
│ (token, │ │ web app files │ │ coming) │
│ keys) │ └─────────────────────┘ └──────────────┘
└─────────────────┘
```
## The CLI
[Section titled “The CLI”](#the-cli)
The `rply` command runs on the agent’s machine. It holds the channel’s agent token and, once the agent requests a secret, a private encryption key. Every command is a short HTTP request; nothing needs to run in the background unless you want the agent woken up or apps to run scripts, which is what `rply serve` is for.
Because it’s a plain command, anything with a shell can use it: agents, scripts, cron jobs, git hooks and CI.
## The server
[Section titled “The server”](#the-server)
The server stores channels, messages, files and accounts, and serves the web app. It’s a single Node.js process with SQLite by default, packaged as one Docker image. [app.rply.sh](https://app.rply.sh) runs the same software as a self-hosted server.
## The apps
[Section titled “The apps”](#the-apps)
The web app is served by the server itself, so every server, hosted or self-hosted, comes with its own copy. It works in any browser and can be added to a phone’s Home Screen. A native mobile app is in progress.
## Waiting without webhooks
[Section titled “Waiting without webhooks”](#waiting-without-webhooks)
Commands like `rply ask --wait` and `rply inbox --wait` use long-polling. The CLI sends a request, and the server holds it open until something happens or about 55 seconds pass. Then the CLI asks again.
That has a few useful consequences:
* It works through any proxy, firewall or NAT. The agent never needs a public address or a webhook.
* A wait can last hours. The CLI keeps reconnecting, so it survives network drops and server restarts.
* The web app gets live updates the same way, through a single sync request per browser.
## Push notifications
[Section titled “Push notifications”](#push-notifications)
Browsers accept push messages signed with the server’s own keys, so every server, including a self-hosted one, can notify its web app directly. The server generates those keys on first start. Notification content passes through the browser vendor’s push service encrypted end to end.
Native mobile apps work differently: Apple and Google only accept pushes signed by the app’s developer. For the mobile app, self-hosted servers will send a content-free “wake up” ping through a small relay run by rply, and the phone then fetches the message from your own server. The relay never sees message content.
## Hosted or self-hosted
[Section titled “Hosted or self-hosted”](#hosted-or-self-hosted)
Both run the same code. The differences are who operates the server and who can read its database:
| | app.rply.sh | Self-hosted |
| --------------------- | ------------------------- | ---------------------- |
| Setup | Sign up | Deploy one container |
| Updates | Automatic | Pull a new image |
| Who can read messages | rply, as the operator | You |
| Limits | Quotas set by app.rply.sh | Whatever you configure |
See [Self-hosting](/docs/self-hosting/overview/) to run your own.
# Messages and questions
> The life of a message: blocks, questions, answers, edits and acknowledgements.
Everything in a channel is a message: updates from the agent, your replies, questions and their answers, pinned statuses, secret requests. This page explains how they relate.
## Messages are text plus blocks
[Section titled “Messages are text plus blocks”](#messages-are-text-plus-blocks)
An agent message has optional text (Markdown), an optional title, and a list of **blocks**. Blocks are typed pieces of content: a table, a progress bar, an image, a choice. The apps know how to draw each type. If an app doesn’t know a block type yet, it shows a short “update the app” placeholder instead of failing, so new block types can ship without breaking older apps.
Your messages to the agent are plain text, optionally with attachments.
## A message with inputs is a question
[Section titled “A message with inputs is a question”](#a-message-with-inputs-is-a-question)
Some blocks are **inputs**: `choice`, `text_input`, `number_input`, `toggle` and `confirm`. A message that contains at least one input is a question. `rply ask` builds those blocks for you; `--blocks` lets you write them yourself, and one message can hold several inputs that are answered together.
When there’s exactly one simple input, such as one set of choices or a confirm button, the app submits as soon as you tap. Otherwise it shows a **Send answers** button.
### The first answer wins
[Section titled “The first answer wins”](#the-first-answer-wins)
A question accepts exactly one answer. Once you’ve answered on one device, it’s answered everywhere, and the agent gets that answer. This makes questions safe to use for approvals: an action can’t be approved twice.
### Expiry, defaults and cancelling
[Section titled “Expiry, defaults and cancelling”](#expiry-defaults-and-cancelling)
* A question can **expire** (`--expires 2h`). After that it stops accepting answers.
* An input can have a **default**. When the question expires, the CLI uses the default as the answer.
* The agent can **cancel** a question (`rply cancel`), or withdraw it by deleting the message. The app shows it as cancelled.
The CLI reports how a question ended through its exit code: `0` answered, `2` expired without a default or timed out, `3` cancelled.
## Answers vs events
[Section titled “Answers vs events”](#answers-vs-events)
Interactive HTML blocks and apps can send two different things back:
* An **answer** completes a question, like tapping a choice. There’s only one.
* An **event** is a notification that something happened, like clicking a bar in a chart. A block can send any number of events, and they don’t answer anything.
Events reach the agent through `rply inbox` like your messages do. Answers come back through `rply ask --wait` or `rply wait` and never appear in the inbox.
## Acknowledgements
[Section titled “Acknowledgements”](#acknowledgements)
When you write to an agent, your message shows its state:
* **Seen** once the agent has read its inbox.
* **Working on it** and **Done** when the agent says so with `rply ack`.
## Edits and deletions
[Section titled “Edits and deletions”](#edits-and-deletions)
Agents can edit their own messages, either replacing the content or patching single blocks by id. Edits show up live in every open app and don’t send notifications. Deleting a message removes it for everyone; deleting an unanswered question withdraws it.
## Pins
[Section titled “Pins”](#pins)
A pinned message floats at the top of the channel instead of sitting in the thread. Each pin has a key, and `status` is the conventional one. Pins are regular messages, so they support the same blocks, edits and patches. When you unpin a message in the app, it moves into the thread at the position it was first posted.
**Apps** are pins too: a pin whose only content is an HTML page, shown full-size under the channel instead of in the chat.
# Security
> What each credential allows, what the server can see, and how secrets stay private.
rply sits between an agent with shell access and the person who directs it. This page describes what each part can do, what the server can see, and where the limits are.
## Credentials
[Section titled “Credentials”](#credentials)
* **Agent tokens** (`rply_a_…`) let one agent post to one channel and read the messages sent to it. They can’t act as you. The server stores only their SHA-256 hash.
* **Accounts** are how people sign in, with an email and password or a passkey. Sessions are cookies in the web app and bearer tokens in other clients.
* **Agent codes and claim links** connect agents and channels. They work once and expire after an hour.
### If an agent token leaks
[Section titled “If an agent token leaks”](#if-an-agent-token-leaks)
Someone with the token can read what you send to that agent and post messages as the agent, including questions. They can’t read other channels, write to the agent as you, or sign in to your account. Revoke the agent in the channel’s agent list and connect it again with a new code.
Because your messages are instructions to an agent with a shell, only signed-in channel members can send them. A token alone is never enough to command the agent.
## What the server can see
[Section titled “What the server can see”](#what-the-server-can-see)
By default, messages are stored in plain text on the server. Whoever operates it can read them:
* On app.rply.sh, that’s rply.
* On a self-hosted server, that’s you.
The server never sees secrets requested with `rply secret request`; see below.
## Secrets
[Section titled “Secrets”](#secrets)
Secret requests are built so the value reaches the agent’s machine without passing through the agent’s context or the server:
1. When the agent first requests a secret, the CLI creates a key pair. The private key stays in the CLI’s config file (permissions `0600`); the public key goes to the server.
2. The app encrypts the value on your device to that public key and sends only the ciphertext.
3. The CLI downloads the ciphertext, decrypts it, writes the file with permissions `0600`, and confirms delivery. The server then deletes the ciphertext.
The encryption is X25519 with HKDF-SHA256 and XChaCha20-Poly1305. The CLI prints only the file path, never the value.
The app also remembers which keys it has encrypted to in each channel. If a request uses a key it hasn’t seen before, it shows the old and new fingerprints and asks you to confirm first. A server that swapped in its own key would be caught at that step.
### Limits
[Section titled “Limits”](#limits)
* **The agent can read the file.** It has a shell. A secret request keeps the value out of the agent’s prompt and logs, not out of its reach.
* **The web app is served by the server.** Someone who controls the server could change the web app’s code to capture a value as you type it. The native mobile app won’t have this weakness, since its code doesn’t come from the server.
## Files
[Section titled “Files”](#files)
Uploads share the server’s address with the web app, so only common image types are shown inline. Everything else, including SVG and HTML, is served as a download with a restrictive content security policy, so an uploaded file can’t run code in the app.
## HTML blocks and apps
[Section titled “HTML blocks and apps”](#html-blocks-and-apps)
Agent-provided HTML runs in a sandboxed frame. It can run scripts, but it can’t read the app, its storage, or your session. Apps can only call command scripts by name; they can’t run arbitrary commands on the agent’s machine. Scripts still receive arguments chosen by the page, so they need to validate them.
## Planned: end-to-end encryption
[Section titled “Planned: end-to-end encryption”](#planned-end-to-end-encryption)
Optional end-to-end encryption per channel is planned. With it, message content would be encrypted with a key that only the agent and your devices have, so not even the server operator could read it.
## Reporting a vulnerability
[Section titled “Reporting a vulnerability”](#reporting-a-vulnerability)
Please report security issues privately through [GitHub](https://github.com/joshuaKnauber/rply/security) rather than in a public issue.
# Build an app
> Give your agent a dashboard or control panel with buttons that run scripts on its machine.
An app is a full-page HTML view that lives under a channel, next to the chat. Use it for dashboards and control panels: a ranking chart that loads fresh data, a button that re-runs an audit, a list of jobs you can pause. It replaces the small website an agent would otherwise have to host.

## 1. Write the page
[Section titled “1. Write the page”](#1-write-the-page)
An app is a single HTML file. Use the CSS variables the app provides so it looks right in light and dark mode:
rankings.html
```html
Rankings
Loading…
```
Fetch data with `rply.call` when the page loads instead of baking it into the HTML. Then the page stays current without being uploaded again.
## 2. Publish it
[Section titled “2. Publish it”](#2-publish-it)
```sh
rply app set rankings rankings.html --title Rankings
```
The app appears under the channel in the sidebar. `rply app set` checks that the page’s inline scripts parse and refuses to upload a page with syntax errors. Running it again replaces the app. List apps with `rply app list` and remove one with `rply app remove rankings`.
## 3. Add command scripts
[Section titled “3. Add command scripts”](#3-add-command-scripts)
`rply.call("stats", …)` runs a script called `stats` on the agent’s machine. Scripts live in the channel’s commands folder:
```sh
rply app commands
```
Each script is an executable named after the command. It gets the arguments as JSON on stdin and prints its result to stdout, as JSON or plain text:
\~/.config/rply/commands/seo-bot/stats
```sh
#!/bin/sh
printf '{"clicks": %s}' "$(./count-clicks.sh)"
```
```sh
chmod +x ~/.config/rply/commands/seo-bot/stats
```
The environment has `RPLY_CHANNEL`, `RPLY_CALL_NAME` and `RPLY_CALL_ID`. A non-zero exit fails the call with the last line of stderr. Calls time out after 30 seconds, and output is limited to 4 MB.
Caution
The page can only name a command; it can’t run arbitrary code on the machine. But it chooses the arguments, so treat them as untrusted input: validate them, and never pass them to a shell unchecked.
Test a script exactly the way the app will run it:
```sh
rply app call stats '{"range":"7d"}'
```
## 4. Run `rply serve`
[Section titled “4. Run rply serve”](#4-run-rply-serve)
Scripts only run while `rply serve` is running for the channel. Install it as a background service, from the project directory:
```sh
rply serve --install
```
It picks up new scripts without a restart. If it’s not running, `rply.call` fails with an `offline` error, which the page should show.
## Ask the agent instead of a script
[Section titled “Ask the agent instead of a script”](#ask-the-agent-instead-of-a-script)
Some actions need the agent itself, not a script. `rply.agent` sends the request to the agent and waits for its answer:
```js
const plan = await rply.agent("plan", { pages: 3 });
```
The call shows up in `rply inbox` with the command to answer it:
```plaintext
call "plan" from app in message 2k9d…: {"pages":3}
answer with: rply respond 7hq1… ''
```
```sh
rply respond 7hq1… '{"titles":["Pricing","Teams","FAQ"]}'
```
Report a failure with `rply respond --error "Couldn't reach the CMS"`. Every `rply.agent` call becomes a message, so use it for real work, never for polling.
## Keep state in the page
[Section titled “Keep state in the page”](#keep-state-in-the-page)
`rply.storage` stores small values per person and app, synced across their devices, for example the selected tab:
```js
const tab = rply.storage.get("tab") ?? "week";
rply.storage.set("tab", "month");
```
## Show a running web app
[Section titled “Show a running web app”](#show-a-running-web-app)
An app can also show a page that’s already running somewhere, like a dev server, so you can try it on your laptop or phone next to the chat. Give `rply app set` a URL instead of a file:
```sh
rply app set preview https://preview.example.ts.net --title Preview
```
The page loads in a frame, with buttons to reload it or open it in a new tab. Some sites refuse to be framed or need cookies that browsers block in frames; open those in a new tab.
rply doesn’t run the tunnel. Your agent knows how to expose a port (`rply guide previews`) and asks you first which way you want. It suggests [OpenTunnel](https://opentunnel.xyz) by default: no account, it keeps running in the background, and the link can’t be guessed, though anyone you share it with can open it. [Tailscale](https://tailscale.com/kb/1312/serve) keeps the page private to your own devices. On exe.dev the VM’s own proxy works too, and cloudflared, ngrok or localtunnel are fine if you already use one.
## Reference
[Section titled “Reference”](#reference)
The full bridge, including `rply.send`, theme handling and the error banner, is in [HTML embeds and apps](/docs/reference/html/).
# Ask questions
> Ask for a decision and wait for the answer.
Use `rply ask` when a decision belongs to the person, not the agent. With `--wait`, the command blocks until they answer and prints the answer, so the agent can continue with it.
## Offer choices
[Section titled “Offer choices”](#offer-choices)
```sh
rply ask "Publish the 5 new pages to acme.dev?" --choices "Publish,Not yet" --wait
```

When they tap a button, the command prints the label and exits:
```plaintext
Publish
```
Use it in a script like any other command:
```sh
if [ "$(rply ask "Deploy to production?" --choices Deploy,Skip --wait)" = "Deploy" ]; then
./deploy.sh
fi
```
Options for choices:
| Option | Effect |
| ----------------- | -------------------------------------------------- |
| `--multi` | Allow picking several. The answer is a JSON array. |
| `--other` | Allow a typed answer besides the choices. |
| `--danger` | Style the choices as destructive. |
| `--title ` | Bold title above the question. |
## Ask for a confirmation
[Section titled “Ask for a confirmation”](#ask-for-a-confirmation)
For a single destructive action, use one confirm button:
```sh
rply ask "Delete the 40 snapshots older than 90 days to free up 31 GB?" \
--confirm "Delete 40 snapshots" --danger --wait
```

## Ask for free text
[Section titled “Ask for free text”](#ask-for-free-text)
Without `--choices`, `--confirm` or input blocks, the person gets a text field:
```sh
rply ask "What should the new landing page headline say?" --wait
```
## Ask several things at once
[Section titled “Ask several things at once”](#ask-several-things-at-once)
Send a form with `--form`. Each field has a `name`, which keys the answer:
```sh
rply ask "New page details" --wait --form '[
{"name":"title","label":"Title","required":true},
{"name":"tone","label":"Tone","type":"select","options":["Formal","Casual"]},
{"name":"notes","label":"Notes","type":"textarea"}
]'
```
Field types are `text` (the default), `textarea`, `number`, `select` and `toggle`. Several questions print a JSON object:
```json
{"title":"Teams pricing","tone":"Casual","notes":"Mention the annual discount"}
```
For full control over the inputs, pass [input blocks](/docs/reference/blocks/#input-blocks) with `--blocks` instead.
## Set a deadline and a default
[Section titled “Set a deadline and a default”](#set-a-deadline-and-a-default)
A question can expire, and it can fall back to a default when it does:
```sh
rply ask "Which tone?" --choices Formal,Casual --default Casual --expires 2h --wait
```
* `--expires 2h` stops accepting answers after two hours.
* `--default Casual` is the answer used if it expires. Without a default, an expired question exits with code 2.
* `--timeout 30m` stops waiting after 30 minutes. When you wait, the question also expires then, unless you set `--expires`.
Durations look like `30s`, `10m`, `2h` or `1d`.
## Ask now, wait later
[Section titled “Ask now, wait later”](#ask-now-wait-later)
Without `--wait`, `rply ask` prints the question’s id and returns immediately:
```plaintext
Asked (id: 9tkppbb8nh0jayn2). Get the answer with: rply wait 9tkppbb8nh0jayn2
```
Do other work, then collect the answer:
```sh
rply wait 9tkppbb8nh0jayn2 --timeout 1h
```
List questions that are still open with `rply asks`, and withdraw one with `rply cancel `.
## Exit codes
[Section titled “Exit codes”](#exit-codes)
| Code | Meaning |
| ---- | ------------------------------------------------- |
| `0` | Answered (or the default was used) |
| `2` | Expired without a default, or `--timeout` ran out |
| `3` | Cancelled |
Note
The first answer wins. Once a question is answered, it can’t be answered again, from any device. Long waits survive network drops and server restarts: the CLI keeps reconnecting until it gets an answer or times out.
# Use several channels
> Run more than one agent or project from the same machine.
A channel is one conversation. Most setups use one channel per agent, but you can split further, for example one channel per project an agent works on. One machine can hold any number of channels.
## Add another channel
[Section titled “Add another channel”](#add-another-channel)
Run `rply init` or `rply join` again. Each channel is saved under a key, a slug of its name unless you pass `--channel`:
```sh
rply init https://app.rply.sh --name "SEO bot"
rply init https://app.rply.sh --name "Deploy bot"
```
The first channel on a machine becomes the default.
## List and pick channels
[Section titled “List and pick channels”](#list-and-pick-channels)
```sh
rply channels
```
```plaintext
* seo-bot "SEO bot" on https://app.rply.sh
deploy-bot "Deploy bot" on https://app.rply.sh
```
The `*` marks the default. Every command uses the default unless you say otherwise:
```sh
rply --channel deploy-bot send "Deployed v2.4.1"
RPLY_CHANNEL=deploy-bot rply send "Deployed v2.4.1"
```
Change the default with `rply channels use deploy-bot`. Forget a channel on this machine with `rply channels remove deploy-bot`; the channel and its messages stay on the server.
## Several agents in one channel
[Section titled “Several agents in one channel”](#several-agents-in-one-channel)
A channel can have several agents, for example a writer and a deploy bot working on the same project. Add one in the app with **Add an agent**, which shows a one-time code for `rply join`. Each agent has its own token, name and bird, and appears separately in the channel’s agent list, where you can revoke it. Once a channel has more than one agent, the app shows each agent’s name on its messages and in notifications.
### Who gets a message
[Section titled “Who gets a message”](#who-gets-a-message)
* **Mention an agent** to send a message only to it: type `@` in the message box and pick one. You can mention several.
* **Reply to an agent’s message** to send yours only to that agent.
* **A message without mentions** reaches every agent. Each one reads the recent conversation with `rply history` and decides whether it’s meant for it, for example leaving it to another agent whose area it is, or one that already answered.
The agents’ inboxes follow these rules, and so does `rply serve --on-message`: every agent in the channel can use it, and each is woken for messages that mention it or nobody. In the inbox, a message addressed to the agent is marked `(mentions you)`.
### What agents know about each other
[Section titled “What agents know about each other”](#what-agents-know-about-each-other)
* `rply whoami` lists the agents in the channel, which of them wakes on messages, and when each was last seen.
* `rply history` shows the recent conversation, including the other agents’ messages, which aren’t in the inbox.
* When an agent joins, the others get “Deploy bot joined the channel.” in their inbox (and it shows in the chat).
The CLI’s guide (`rply guide basics`) teaches agents all of this, so you don’t need to explain it in their instructions.
### Pins and edits
[Section titled “Pins and edits”](#pins-and-edits)
Agents can only edit, delete or cancel their own messages. A pin belongs to the agent that set it first; another agent that tries to change it is told to use its own key, such as `status-deploy`. A channel can have any number of pins, so each agent keeps its own.
## Background services
[Section titled “Background services”](#background-services)
`rply serve --install` installs one service per channel. Run it once for each channel that should wake its agent or run app scripts:
```sh
rply --channel seo-bot serve --install --on-message '…'
rply --channel deploy-bot serve --install
```
Command scripts for apps are also per channel; `rply --channel app commands` shows each folder.
# Share files
> Send files both ways between you and your agent.
Agents can attach images and files to messages and pins, and people can attach files when they write to an agent.
## Send files from the agent
[Section titled “Send files from the agent”](#send-files-from-the-agent)
```sh
rply send "Weekly report" --image chart.png --file keywords.csv
```
`--image` and `--file` can be repeated, and work on `rply pin set` too. Images show inline in the chat; other files show as a row with their type, name and size.
To place files inside [blocks](/docs/reference/blocks/), upload first and reference the id:
```sh
rply file upload chart.png
```
```json
[{"type":"image","file_id":"","alt":"Clicks per day"}]
```
## Download files from the person
[Section titled “Download files from the person”](#download-files-from-the-person)
When someone attaches a file to a message, `rply inbox` lists it with the command to download it:
```plaintext
[10/13/2026, 9:40:11 AM] (8m3k…) Here's the brief for the new pages
attachment: brief.pdf (application/pdf, 48211 bytes), download with: rply file get 3x8n…
```
```sh
rply file get 3x8n… --to briefs/teams.pdf
```
Without `--to`, the file is saved under its own name in the current directory. Use `--force` to overwrite an existing file.
## Limits
[Section titled “Limits”](#limits)
* Files can be up to 25 MB each on a default server. Self-hosted servers can change this with `RPLY_FILES_MAX_SIZE`; see [Configuration](/docs/self-hosting/configuration/#files).
* A file is deleted when the message it was first attached to is deleted. Uploads that are never used in a message are removed after 24 hours.
* Channels that haven’t been claimed yet can’t upload files.
# Take instructions from the app
> Read the messages you send to your agent and tell you what it's doing.
People can write to an agent at any time from the app, for example “Add a page for the Teams plan”. This guide shows how the agent reads those messages and reports back.
## Read new messages
[Section titled “Read new messages”](#read-new-messages)
```sh
rply inbox
```
```plaintext
[10/13/2026, 12:05:52 AM] (6rwj83hpj0j8fv2q) Nice. Draft pages for the top 5.
[10/13/2026, 12:09:34 AM] (90rsxg78rg81gzfx) Also add a page for the Teams plan
Acknowledge with: rply ack working|done
```
`rply inbox` prints messages it hasn’t shown before and marks them as seen. Useful options:
| Option | Effect |
| --------------- | ----------------------------------------------------- |
| `--wait` | Block until at least one message arrives. |
| `--timeout 10m` | Give up waiting after a while (exit code 2). |
| `--peek` | Don’t mark messages as seen. |
| `--since ` | Start after a given cursor instead of the stored one. |
Add the global `--json` flag to get one JSON object per line, with `id`, `sender`, `created_at`, `state`, `mentions` and `body`.
If the channel has several agents, each inbox only gets the messages that mention that agent or nobody. See [Several agents in one channel](/docs/guides/channels/#several-agents-in-one-channel).
Answers to questions don’t show up here. They come back through `rply ask --wait` and `rply wait`.
## Stream messages as they arrive
[Section titled “Stream messages as they arrive”](#stream-messages-as-they-arrive)
For an agent that runs all the time, `rply listen` prints each message as it arrives, until you stop it with Ctrl+C:
```sh
rply listen --json | while read -r line; do
echo "$line" | ./handle-message.sh
done
```
## Tell the person what you’re doing
[Section titled “Tell the person what you’re doing”](#tell-the-person-what-youre-doing)
Acknowledge a message so the person knows it was picked up:
```sh
rply ack 90rsxg78rg81gzfx working
rply ack 90rsxg78rg81gzfx done
```
The state shows next to the message in the app. Reading the inbox already marks messages as `seen`.

## Wake the agent when a message arrives
[Section titled “Wake the agent when a message arrives”](#wake-the-agent-when-a-message-arrives)
Most agents don’t run all the time. `rply serve --on-message` runs a command whenever the person writes, for example a headless Claude Code run:
```sh
rply serve --install --on-message 'claude -p "You have new messages in rply. Run rply inbox and handle them."'
```
The new messages are passed to the command as JSON on stdin, and `RPLY_CHANNEL` is set. See [Set up your agent](/docs/start/agent-setup/#5-install-the-background-service) for the details.
## Events from embeds and apps
[Section titled “Events from embeds and apps”](#events-from-embeds-and-apps)
HTML blocks and apps can send events, for example when someone clicks a bar in a chart. They show up in the inbox alongside messages:
```plaintext
[10/13/2026, 9:31:02 AM] (4m2k…) event "Show Tuesday" from chart in message pweehax515jh7zv2: {"day":"tue"}
```
Calls from apps that ask the agent for something look like this, with the command to answer them:
```plaintext
[10/13/2026, 9:32:40 AM] (7hq1…) call "plan" from app in message 2k9d…: {"pages":3}
answer with: rply respond 7hq1… ''
```
See [Build an app](/docs/guides/apps/) for how apps call the agent.
## Attachments
[Section titled “Attachments”](#attachments)
When the person attaches a file, the inbox shows how to download it:
```plaintext
attachment: brief.pdf (application/pdf, 48211 bytes), download with: rply file get 3x8n…
```
# Keep a live status
> Pin a message to the top of the chat and update it in place.
A status is a pinned message that stays at the top of the channel and changes over time. Use it for the current state of a long job instead of sending a message for every step.

## Set the status
[Section titled “Set the status”](#set-the-status)
`rply status set` replaces the status with a list of [blocks](/docs/reference/blocks/). Give every block you want to update later an `id`:
```sh
rply status set '[
{"type":"keyvalue","id":"stats","items":[{"key":"Pages live","value":"42"},{"key":"Indexed","value":"38"}]},
{"type":"progress","id":"drafts","label":"Drafting new pages","value":0,"max":5}
]'
```
It also accepts a file path or `-` for stdin, which is easier for larger statuses:
```sh
rply status set status.json
```
## Update one value
[Section titled “Update one value”](#update-one-value)
Patch a block by its id. Only the fields you pass change:
```sh
rply status patch '{"id":"drafts","value":3}'
```
Patch several blocks at once with an array:
```sh
rply status patch '[{"id":"drafts","value":5},{"id":"stats","items":[{"key":"Pages live","value":"47"},{"key":"Indexed","value":"38"}]}]'
```
Read the current status as JSON with `rply status get`.
## Use other pins
[Section titled “Use other pins”](#use-other-pins)
`status` is just the conventional key. Pin as many messages as you like, each with its own key:
```sh
rply pin set overview "**3 projects** running" --title Overview
rply pin patch overview --patch '{"id":"pages","value":7}'
rply pin list
rply pin remove overview
```
`rply pin set` takes the same text, `--title`, `--blocks`, `--image` and `--file` options as `rply send`. Keys are 1 to 32 characters of lowercase letters, digits, `-` and `_`.
## When the person unpins it
[Section titled “When the person unpins it”](#when-the-person-unpins-it)
People can unpin a message in the app. It then moves into the thread at the position it was first sent. After that, `rply status patch` (or `rply pin patch`) fails because there’s no pin to patch, and the next `rply status set` creates a new pinned message.
Tip
Patching a status doesn’t send a notification. To tell the person something changed, send a short message as well, for example when a long job finishes.
# Get notifications
> Turn on push notifications in the browser and on your phone.
rply notifies you when an agent sends a message, asks a question or requests a secret. Notifications work even when the app isn’t open.
## In the browser
[Section titled “In the browser”](#in-the-browser)
1. Open the web app, for example [app.rply.sh](https://app.rply.sh).
2. Click the bell at the top of the sidebar.
3. Allow notifications when the browser asks.
That’s it for every channel in your account; you don’t need to turn them on per channel. Clicking a notification opens the channel. A new notification from the same channel replaces the previous one, so a busy agent doesn’t flood your notification center.
## On iPhone and iPad
[Section titled “On iPhone and iPad”](#on-iphone-and-ipad)
iOS only delivers web notifications to apps on the Home Screen:
1. Open the web app in Safari.
2. Tap the share button, then **Add to Home Screen**.
3. Open rply from the Home Screen, sign in, and tap the bell.
On Android, the steps for the browser work as they are.

## What notifies
[Section titled “What notifies”](#what-notifies)
| Event | Notifies |
| ---------------------------- | -------------------------------- |
| A new message from an agent | Yes, unless sent with `--silent` |
| A question (`rply ask`) | Yes |
| A secret request | Yes |
| A status or pin update | No |
| Edits to an existing message | No |
| Your own messages | No |
You also aren’t notified about the channel you’re looking at while the tab is visible.
## The mobile app
[Section titled “The mobile app”](#the-mobile-app)
A native app for iOS and Android with the same features is in progress. Until then, the web app added to your Home Screen works the same way.
Self-hosting?
Web push works on your own server without any setup: the server creates its own keys on first start. Push services require HTTPS, except on `localhost`. See [Configuration](/docs/self-hosting/configuration/#push-notifications).
# Use rply in scripts and CI
> Use rply from cron jobs, git hooks and CI, not just agents.
The `rply` CLI works the same without an agent. Any script that can run a command can notify you, ask for approval, or keep a status up to date.
## Send from a cron job
[Section titled “Send from a cron job”](#send-from-a-cron-job)
backup.sh
```sh
#!/bin/sh
if restic backup /data; then
rply send "Backup finished" --silent
else
rply send "**Backup failed.** Check the logs on $(hostname)."
fi
```
## Configure with environment variables
[Section titled “Configure with environment variables”](#configure-with-environment-variables)
Machines without a config file, such as CI runners, can pass the channel through environment variables instead:
```sh
export RPLY_SERVER=https://app.rply.sh
export RPLY_TOKEN=rply_a_… # an agent token for the channel
rply send "Build #482 passed"
```
`RPLY_SERVER` and `RPLY_TOKEN` override the config file. To get a token, run `rply init` or `rply join` on any machine and copy `token` from the channel’s entry in `~/.config/rply/config.json`. Store it as a secret in your CI system.
Caution
An agent token can post to the channel and read your messages to it. Keep it in your CI’s secret store, never in the repository. Revoke it from the channel’s agent list in the app if it leaks.
## Ask for approval in GitHub Actions
[Section titled “Ask for approval in GitHub Actions”](#ask-for-approval-in-github-actions)
`rply ask --wait` blocks until you answer, which makes it a simple approval gate:
.github/workflows/deploy.yml
```yaml
jobs:
deploy:
runs-on: ubuntu-latest
env:
RPLY_SERVER: https://app.rply.sh
RPLY_TOKEN: ${{ secrets.RPLY_TOKEN }}
steps:
- uses: actions/checkout@v4
- name: Ask for approval
run: |
answer=$(npx @rply/cli ask "Deploy ${{ github.sha }} to production?" \
--choices Deploy,Cancel --timeout 30m --wait)
test "$answer" = "Deploy"
- run: ./deploy.sh
```
If nobody answers within 30 minutes, the command exits with code 2 and the job fails.
## Exit codes
[Section titled “Exit codes”](#exit-codes)
| Code | Meaning |
| ---- | -------------------------------------------------- |
| `0` | Success |
| `1` | Error, for example a network or validation error |
| `2` | Timed out, or a question expired without a default |
| `3` | Cancelled or declined |
## JSON output
[Section titled “JSON output”](#json-output)
Add `--json` before the command to get machine-readable output:
```sh
rply --json send "Build #482 passed"
rply --json ask "Deploy?" --choices Deploy,Cancel --wait
```
With `--wait`, `ask` prints `{ status, answers, message_id }`. `rply inbox --json` and `rply listen --json` print one message per line.
## Keep it quiet
[Section titled “Keep it quiet”](#keep-it-quiet)
Two notices go to stderr: an update notice when a newer CLI version exists, and a hint to read `rply guide`. Turn them off in scripts:
```sh
export RPLY_NO_UPDATE_CHECK=1 RPLY_NO_GUIDE_HINT=1
```
# Request secrets
> Get API keys from you without them passing through the agent or the server.
Agents often need credentials: an API key, a database URL, a service account file. Pasting them into a chat puts them in the agent’s context and in its provider’s logs. `rply secret request` avoids that. The person enters the value in the app, it’s encrypted on their device, and the CLI writes it straight to a file. The agent only learns the file path.
## Request a secret
[Section titled “Request a secret”](#request-a-secret)
```sh
rply secret request STRIPE_SECRET_KEY --to .env --reason "For the webhook endpoint" --wait
```
The person sees a masked field with the name, the file it will be written to, and your reason:

When they send it, the CLI writes the file and prints only the path:
```plaintext
STRIPE_SECRET_KEY written to /srv/shop/.env
```
The value is never printed, logged or returned. The file is written with permissions `0600`.
## Choose how the value is written
[Section titled “Choose how the value is written”](#choose-how-the-value-is-written)
* **`.env` mode (the default)** writes a `NAME=value` line. If the file already has a `STRIPE_SECRET_KEY=` line, it’s replaced and the rest of the file is kept. The name has to look like an environment variable.
* **File mode** (`--file`) writes the value as the whole file, for things like a JSON key:
```sh
rply secret request SERVICE_ACCOUNT --to key.json --file --wait
```
## Request now, collect later
[Section titled “Request now, collect later”](#request-now-collect-later)
Without `--wait`, the command prints an id and returns:
```plaintext
Requested STRIPE_SECRET_KEY (id: ynpg0mbv8y75hmdq). Write it when provided with: rply secret fetch ynpg0mbv8y75hmdq --wait
```
Collect it later with `rply secret fetch --wait`, or withdraw the request with `rply secret cancel `.
## Options
[Section titled “Options”](#options)
| Option | Effect |
| ---------------------- | -------------------------------------------------------------------------------- |
| `--to ` | The file to write. Shown to the person as an absolute path. |
| `--file` | Write the value as the whole file instead of a `NAME=value` line. |
| `--reason ` | Why you need it, shown to the person. |
| `--expires ` | Stop accepting the secret after e.g. `1h`. Defaults to `--timeout` when waiting. |
| `--wait` | Block until the secret is written. |
| `--timeout ` | Give up waiting after e.g. `30m`. |
Exit codes: `2` if the request expired or `--timeout` ran out, `3` if the person declined or it was cancelled.
## Checking the agent’s key
[Section titled “Checking the agent’s key”](#checking-the-agents-key)
Each agent has its own encryption key. The app remembers the keys it has encrypted to in each channel. If a request comes from a key it hasn’t seen before, for example a new agent or one that was set up again, it shows the old and new fingerprints and asks you to confirm before encrypting. That stops a compromised server from swapping in its own key.
## What this protects against
[Section titled “What this protects against”](#what-this-protects-against)
* The value never appears in the agent’s prompt, output or logs, unless the agent reads the file.
* The server only ever sees ciphertext, and deletes it once the CLI confirms delivery.
* Requests work once and expire.
What it doesn’t protect against:
* The agent has a shell, so it can read the file after it’s written. Treat the agent’s machine as able to see the secret.
* In the web app, the code that encrypts is served by the server. Someone who controls the server could change that code to capture the value as you type it. The mobile app won’t have this weakness.
See [Security](/docs/concepts/security/) for the full model.
Note
Secrets need a channel saved with `rply init` or `rply join`. They don’t work with the `RPLY_SERVER` and `RPLY_TOKEN` environment variables.
# Send updates
> Post messages, Markdown, images and files from your agent.
Use `rply send` to tell the person behind the agent what happened. Every message notifies them unless you make it silent.
## Send text
[Section titled “Send text”](#send-text)
```sh
rply send "Deployed 3 new pages to acme.dev"
```
The text supports Markdown: bold, lists, links, code and tables.
```sh
rply send "Keyword research is done. I found **14 new topics**:
- agent notifications (2.4k searches)
- ai agent approval (1.9k)"
```
Add a bold title above the text with `--title`:
```sh
rply send "All 312 tests passed." --title "CI on main"
```
The command prints the new message’s id, which you need to edit or delete it later:
```plaintext
Sent (id: e43y8bbrsrsyawxr)
```
## Attach images and files
[Section titled “Attach images and files”](#attach-images-and-files)
```sh
rply send "Clicks are up 38% this week." --image chart.png
rply send "Here's the crawl export." --file keywords.csv
```
Both flags can be repeated. Images show inline; other files show as a download row.
## Send rich content with blocks
[Section titled “Send rich content with blocks”](#send-rich-content-with-blocks)
For more than text, pass a JSON array of [blocks](/docs/reference/blocks/) with `--blocks`. It accepts inline JSON, a file path, or `-` to read from stdin:
```sh
rply send "Weekly report" --blocks '[
{"type":"keyvalue","items":[{"key":"Pages live","value":"42"},{"key":"Indexed","value":"38"}]},
{"type":"table","columns":["Page","Clicks"],"rows":[["/pricing",1204],["/compare",866]]}
]'
```
## Send without a notification
[Section titled “Send without a notification”](#send-without-a-notification)
Routine updates don’t need to buzz a phone:
```sh
rply send "Backup finished: 2.1 GB uploaded." --silent
```
The message still appears in the channel.
## Edit or delete a message
[Section titled “Edit or delete a message”](#edit-or-delete-a-message)
Update a message you sent instead of sending a new one:
```sh
rply edit e43y8bbrsrsyawxr "Deployed 5 new pages to acme.dev"
```
To change one block, give it an `id` when you send it and patch it by that id:
```sh
rply send "Crawling acme.dev" --blocks '[{"type":"progress","id":"crawl","value":0,"max":120}]'
rply edit --patch '{"id":"crawl","value":42}'
```
Delete a message with `rply delete `. Deleting an unanswered question withdraws it.
Tip
For an overview that stays at the top of the chat and changes over time, use a [live status](/docs/guides/live-status/) instead of editing a message in the thread.
# Integrations
> Plugins that connect agent frameworks to rply directly, instead of through the CLI.
Any agent with a shell can use rply through the [CLI](/docs/start/agent-setup/). Some agent frameworks also have their own messaging layer, the part that connects them to Telegram, Slack and similar apps. For those, an integration plugs rply in at that level: your messages reach the agent directly, its replies come back as rply messages, and its approvals and questions become rply questions. There’s no wake command to set up.
| Framework | Integration | What it covers |
| ------------------------------------------ | ------------------------- | ------------------------------------------------------------------------------------- |
| [Hermes Agent](/docs/integrations/hermes/) | Messaging platform plugin | Messages, files, approvals, questions, secrets, scheduled jobs, a dashboard, profiles |
An agent with an integration can still use the CLI for what the integration doesn’t cover, like custom apps. Where the two overlap, follow the integration’s instructions.
# Hermes Agent
> Talk to Hermes Agent from rply: messages, files, approvals, secrets, scheduled jobs and a dashboard, through a Hermes messaging platform plugin.
[Hermes Agent](https://hermes-agent.nousresearch.com) talks to you through messaging platforms like Telegram or Discord. The rply plugin adds rply as one of them. Once it’s set up, you write to Hermes in the rply app on your phone or laptop and it answers there, with push notifications, buttons for its questions, and a dashboard for its scheduled jobs.
## What you get
[Section titled “What you get”](#what-you-get)
* **Messages both ways.** Your messages go straight to Hermes, and its replies arrive as rply messages with markdown. Under your message you see Seen, Working on it (with what it’s doing right now, like “running terminal”) and Done.
* **Files both ways.** Send Hermes screenshots or documents, and get its charts and files back with previews.
* **Questions with buttons.** When Hermes asks you to choose, you get the options as a question, including multi-select and an “other” field.
* **Approvals.** When Hermes wants to run a command that needs your OK, you get Approve once, Approve for this session, Always approve and Deny. If nobody answers before Hermes’ approval timeout, the command doesn’t run.
* **Secrets.** Hermes asks for API keys with the `rply_request_secret` tool. You type the key into a masked field, it’s encrypted on your device, and the plugin saves it to Hermes’ `.env`. Hermes only learns that it was saved.
* **Scheduled jobs.** Jobs created with `--deliver rply` send their results to the channel. A pinned “Scheduled jobs” table shows every job’s last run, result and next run.
* **A dashboard.** A Hermes app under the channel shows your model, jobs, recent sessions and token use, with buttons to run, pause and resume jobs.
* **Profiles.** Each Hermes profile joins the channel as its own agent. Mention one with `@name`; messages without a mention go to all of them.
## Set it up
[Section titled “Set it up”](#set-it-up)
You need Hermes Agent 0.22.2 or newer and an rply account, for example on [app.rply.sh](https://app.rply.sh).
### Let Hermes do it
[Section titled “Let Hermes do it”](#let-hermes-do-it)
In the rply app, create a channel and copy the setup prompt it shows, then paste it into Hermes. The prompt has a branch for Hermes: it installs the plugin, connects with the channel’s agent code and restarts the gateway.
### Or by hand
[Section titled “Or by hand”](#or-by-hand)
1. Install and enable the plugin:
```sh
hermes plugins install rply-platform --enable
```
2. In the rply app, create a channel for Hermes. The app shows an agent code. For a channel you already have, open it and choose **Add an agent**.
3. Run Hermes’ gateway setup, pick **rply** and enter the code:
```sh
hermes gateway setup
```
Leave the code empty to create a new channel instead. Setup then prints a link that adds the channel to your rply account.
Without the menu, the same works as one command: `hermes rply join `, or `hermes rply init --name ""` to create a channel.
4. Restart the gateway, or install it if you haven’t yet:
```sh
hermes gateway restart # or: hermes gateway install
```
Hermes posts “Gateway online” to the channel when it’s connected. Write it a message to try it.
To send a scheduled job’s results to rply, create it with `--deliver rply`:
```sh
hermes cron create --name "Morning summary" --deliver rply "0 8 * * *" "Summarize what happened yesterday."
```
## Several profiles
[Section titled “Several profiles”](#several-profiles)
Every profile has its own copy of the plugin and its own rply agent. Set each one up against the same channel with an agent code of its own:
```sh
hermes -p research plugins install rply-platform --enable
hermes -p research rply join https://app.rply.sh
hermes gateway restart
```
The agent is named after the profile, and its pins and dashboard get the profile name too, like “Scheduled jobs · research”. A profile created with `hermes profile create --clone` already has the plugin. Update the plugin in every profile when a new version comes out.
## Settings
[Section titled “Settings”](#settings)
Setup writes these to the profile’s `.env`:
| Variable | Meaning |
| -------------------- | ------------------------------------------------------------------------------------------------ |
| `RPLY_TOKEN` | The agent token for the channel. |
| `RPLY_SERVER` | The rply server, `https://app.rply.sh` unless you self-host. |
| `RPLY_ALLOWED_USERS` | The channel id. Only members of the channel can post to it, so it’s the one user Hermes accepts. |
Hermes announces restarts in the channel (“Hermes is restarting”, “Gateway online”). To turn that off for rply, run this for each profile (add `-p ` for named ones) and restart the gateway:
```sh
hermes config set platforms.rply.gateway_restart_notification false
```
## If you used the CLI before
[Section titled “If you used the CLI before”](#if-you-used-the-cli-before)
If Hermes was connected to rply through the CLI first, remove that setup so it doesn’t run twice:
* Reinstall `rply serve` without `--on-message`, or uninstall it with `rply serve --uninstall`. Otherwise every message wakes a second Hermes run.
* Remove the rply lines from Hermes’ instructions file (`~/.hermes.md` or similar). The plugin tells Hermes how to reply, and the CLI’s lines would have it use `rply send` and `rply secret request` instead.
## Using the CLI next to the plugin
[Section titled “Using the CLI next to the plugin”](#using-the-cli-next-to-the-plugin)
The [rply CLI](/docs/reference/cli/) adds custom questions, pins and apps. Install it with `npm install --global @rply/cli`. Inside Hermes it uses the plugin’s connection automatically: Hermes sets `HERMES_HOME` to the profile, and the CLI reads `RPLY_SERVER` and `RPLY_TOKEN` from that profile’s `.env`. Each profile stays one agent, and you never run `rply join` for Hermes. `rply serve` and `rply secret request` refuse to run there, since the plugin wakes Hermes and has its own secret tool.
## What the plugin does on your machine
[Section titled “What the plugin does on your machine”](#what-the-plugin-does-on-your-machine)
* Keeps one long-running connection to your rply server for messages and dashboard calls.
* Reads Hermes’ scheduled jobs and session list for the pinned table and the dashboard, and runs, pauses or resumes jobs when you press the dashboard’s buttons.
* Stores the agent token in the profile’s `.env`, its position in the channel and a keypair for secrets in the profile’s `rply/` folder (the keypair with permissions `0600`).
* Saves secrets you send to the profile’s `.env`.
It talks to no other service. Encrypted rply channels aren’t supported yet; their messages are skipped.
# HTTP API
> Use rply without the CLI.
The CLI is a thin wrapper around an HTTP API. You can call it directly from any language, or with `curl` in places where installing Node isn’t practical. All routes are under `/v1` on your server, e.g. `https://app.rply.sh/v1`.
## Authentication
[Section titled “Authentication”](#authentication)
Agents authenticate with their agent token as a bearer token:
```sh
-H "Authorization: Bearer rply_a_…"
```
The token determines the channel, so agent routes don’t need a channel id. Get a token with `rply init` or `rply join`; it’s stored in the CLI’s [config file](/docs/reference/cli-config/#config-file).
## Send a message
[Section titled “Send a message”](#send-a-message)
```sh
curl -X POST https://app.rply.sh/v1/messages \
-H "Authorization: Bearer $RPLY_TOKEN" \
-H "Content-Type: application/json" \
-d '{"body":{"text":"Build #482 passed"}}'
```
```json
{"message":{"id":"fztfqpexn1956jpa","sender":"agent","created_at":1791843427399,"body":{"text":"Build #482 passed"}, …}}
```
The body takes `text`, `title` and `blocks`. Add `"silent": true` next to `body` to skip the push notification.
## Ask a question and wait for the answer
[Section titled “Ask a question and wait for the answer”](#ask-a-question-and-wait-for-the-answer)
A message with [input blocks](/docs/reference/blocks/#input-blocks) is a question:
```sh
curl -X POST https://app.rply.sh/v1/messages \
-H "Authorization: Bearer $RPLY_TOKEN" \
-H "Content-Type: application/json" \
-d '{"body":{"text":"Deploy?","blocks":[{"type":"choice","id":"answer","options":[{"label":"Deploy"},{"label":"Cancel"}]}]}}'
```
Then wait for it with a long-poll, using the id from the response:
```sh
curl "https://app.rply.sh/v1/asks/?wait=55" -H "Authorization: Bearer $RPLY_TOKEN"
```
The response is `{ message, answer }`. The question’s state is in `message.ask.status`: `open`, `answered`, `expired` or `cancelled`. While it’s still `open`, call again.
## Long-polling
[Section titled “Long-polling”](#long-polling)
Routes that take `wait` hold the request open for up to that many seconds and answer as soon as something changes. If nothing changes, they answer empty, and you ask again. Keep `wait` at 55 or below so proxies don’t cut the connection.
## Read messages from the person
[Section titled “Read messages from the person”](#read-messages-from-the-person)
```sh
curl "https://app.rply.sh/v1/messages?sender=human&since=0&wait=55" \
-H "Authorization: Bearer $RPLY_TOKEN"
```
The response is `{ messages, cursor }`. Pass `cursor` as `since` on the next call. Reading as the agent marks the messages as seen; add `peek=1` to avoid that.
## Endpoints for agents
[Section titled “Endpoints for agents”](#endpoints-for-agents)
| Method and path | Description |
| ---------------------------------------------- | -------------------------------------------------------------------------------------------------------- |
| `POST /v1/messages` | Send a message or ask a question. |
| `GET /v1/messages?since=&wait=&sender=&peek=1` | Read messages, optionally waiting. |
| `PATCH /v1/messages/:id` | Edit a message: `title`, `text`, `blocks`, or `block_patches` merged by block id. |
| `PUT /v1/messages/:id` | Replace a message’s body. |
| `DELETE /v1/messages/:id` | Delete a message. |
| `POST /v1/messages/:id/state` | Acknowledge a message from the person: `{ "state": "seen" \| "working" \| "done" }`. |
| `POST /v1/messages/:id/cancel` | Cancel a question. |
| `GET /v1/asks` | List open questions. |
| `GET /v1/asks/:id?wait=` | Wait for a question’s answer. |
| `GET /v1/pins` | List pinned messages. |
| `PUT /v1/pins/:key` | Create or replace a pin. |
| `PATCH /v1/pins/:key` | Update a pin. |
| `DELETE /v1/pins/:key` | Remove a pin. |
| `POST /v1/files?name=` | Upload a file as the raw request body, with its `Content-Type`. Returns `{ file_id, name, mime, size }`. |
| `GET /v1/files/:id` | Download a file. |
| `GET /v1/channel` | The channel’s details. |
| `PATCH /v1/agent` | Rename this agent: `{ "label": "…" }`. |
Secret requests also go through the API, but decrypting them requires the CLI’s key handling; use `rply secret request`.
## Other endpoints
[Section titled “Other endpoints”](#other-endpoints)
| Method and path | Description |
| --------------- | ------------------------------------------------------------------------------------------------------------------------ |
| `GET /health` | `{ "ok": true }` when the server is up. |
| `GET /v1/info` | Public server info: whether it needs setup, registration mode, and which features (files, push, passkeys, email) are on. |
## Errors and limits
[Section titled “Errors and limits”](#errors-and-limits)
Errors return a JSON body with an `error` message and a matching status code: `400` for invalid input, `401` for a missing or revoked token, `404` for unknown ids, `409` when a question was already answered, and `429` when a rate limit is hit (120 writes a minute per channel).
# Blocks
> Every block type an agent can send, with examples.
Blocks are typed pieces of content in a message: a table, a progress bar, a choice. Pass them as a JSON array with `--blocks` on `rply send`, `rply ask`, `rply pin set` and `rply edit`, or as the argument to `rply status set`. Each option also accepts a file path, or `-` for stdin.
```sh
rply send "Weekly report" --blocks '[{"type":"heading","text":"acme.dev"},{"type":"progress","value":42,"max":120,"label":"Pages crawled"}]'
```
Every block has a `type`. An optional `id` (1 to 64 characters) lets you patch the block later with `--patch '{"id":"…", …}'`. Input blocks require an `id`, which keys their answer.
## Display blocks
[Section titled “Display blocks”](#display-blocks)
### `markdown`
[Section titled “markdown”](#markdown)
```json
{"type":"markdown","text":"**Bold**, lists and [links](https://rply.sh)"}
```
### `heading`
[Section titled “heading”](#heading)
```json
{"type":"heading","text":"Results"}
```
### `code`
[Section titled “code”](#code)
```json
{"type":"code","code":"npm run build","language":"sh"}
```
### `link`
[Section titled “link”](#link)
```json
{"type":"link","url":"https://acme.dev/pricing","label":"Open the new pricing page"}
```
### `progress`
[Section titled “progress”](#progress)
| Field | Type | |
| ------- | ------ | ------------------- |
| `value` | number | Required. |
| `max` | number | Optional, positive. |
| `label` | string | Optional. |
```json
{"type":"progress","id":"crawl","value":42,"max":120,"label":"Pages crawled"}
```
### `keyvalue`
[Section titled “keyvalue”](#keyvalue)
```json
{"type":"keyvalue","items":[{"key":"Pages live","value":"42"},{"key":"Indexed","value":"38"}]}
```
Both `key` and `value` are strings.
### `table`
[Section titled “table”](#table)
```json
{"type":"table","columns":["Keyword","Rank"],"rows":[["agent inbox",4],["ai approvals",7]]}
```
Cells are strings or numbers.
### `image`
[Section titled “image”](#image)
| Field | Type | |
| --------- | ------ | ---------------------------------- |
| `file_id` | string | Required. From `rply file upload`. |
| `name` | string | Optional. |
| `alt` | string | Optional. |
```json
{"type":"image","file_id":"9fk2…","alt":"Clicks per day"}
```
`rply send --image chart.png` creates this block for you.
### `file`
[Section titled “file”](#file)
| Field | Type | |
| --------- | ------ | ---------------------------------- |
| `file_id` | string | Required. From `rply file upload`. |
| `name` | string | Required. |
| `mime` | string | Optional. |
| `size` | number | Optional, in bytes. |
### `html`
[Section titled “html”](#html)
Runs your HTML in a sandboxed frame inside the message. See [HTML embeds and apps](/docs/reference/html/).
| Field | Type | |
| ---------- | ------- | ------------------------------------------------------------------------------------ |
| `html` | string | Required. A fragment or a full document. |
| `label` | string | Optional header above the embed. |
| `height` | number | Optional fixed height in pixels, up to 2000. Otherwise it grows to fit. |
| `question` | boolean | Optional. Makes the embed a question answered with `rply.reply()`. Requires an `id`. |
## Input blocks
[Section titled “Input blocks”](#input-blocks)
A message with at least one input block is a question. Inputs need an `id`, unique within the message. The answer is keyed by that id: one input prints its value, several print a JSON object.

### `choice`
[Section titled “choice”](#choice)
| Field | Type | |
| ---------- | --------------- | ---------------------------------------------------------------------------- |
| `options` | array | Required. Each has `label`, and optionally `value`, `description`, `danger`. |
| `label` | string | Optional. |
| `multi` | boolean | Allow picking several. The answer is an array. |
| `other` | boolean | Allow a typed answer besides the options. |
| `required` | boolean | |
| `default` | string or array | Used if the question expires. |
```json
{"type":"choice","id":"tone","label":"Tone","options":[{"label":"Formal"},{"label":"Casual","description":"Default"}],"default":"Casual"}
```
### `text_input`
[Section titled “text_input”](#text_input)
| Field | Type | |
| ------------- | ------- | - |
| `label` | string | |
| `placeholder` | string | |
| `multiline` | boolean | |
| `required` | boolean | |
| `default` | string | |
```json
{"type":"text_input","id":"title","label":"Title","required":true}
```
### `number_input`
[Section titled “number_input”](#number_input)
| Field | Type | |
| ------------ | ------- | - |
| `label` | string | |
| `min`, `max` | number | |
| `required` | boolean | |
| `default` | number | |
```json
{"type":"number_input","id":"count","label":"How many pages?","min":1,"max":50}
```
### `toggle`
[Section titled “toggle”](#toggle)
| Field | Type | |
| --------- | ------- | --------- |
| `label` | string | Required. |
| `default` | boolean | |
```json
{"type":"toggle","id":"notify","label":"Email subscribers"}
```
### `confirm`
[Section titled “confirm”](#confirm)
A single button. Answering it confirms.
| Field | Type | |
| ------------- | ------- | -------------------------- |
| `label` | string | Required. The button text. |
| `description` | string | Optional. |
| `danger` | boolean | Style as destructive. |
```json
{"type":"confirm","id":"go","label":"Deploy now","description":"Takes about 2 minutes"}
```
### How questions are submitted
[Section titled “How questions are submitted”](#how-questions-are-submitted)
When a message has exactly one simple input (a single choice, a confirm button, or an html question), the app submits as soon as the person picks. Otherwise it shows a **Send answers** button for all inputs together.
## Unknown block types
[Section titled “Unknown block types”](#unknown-block-types)
The server accepts block types it doesn’t know, and the apps show them as a short “update the app” placeholder. That lets new block types ship without breaking older apps. Known types are validated: a malformed `table` or a choice without options is rejected with a 400 error that names the invalid field, and the CLI adds a pointer to `rply guide blocks`.
# CLI commands
> Every rply command and its options.
Install the CLI with `npm install --global @rply/cli`, or run any command with `npx @rply/cli `. Every command accepts `--help`.
## Global options
[Section titled “Global options”](#global-options)
| Option | Description |
| ----------------- | --------------------------------------------------------------------------------- |
| `--json` | Machine-readable JSON output. Put it before the command: `rply --json send …`. |
| `--channel ` | Which local channel to use. Defaults to `RPLY_CHANNEL`, then the default channel. |
| `-V`, `--version` | Print the version. |
Durations look like `30s`, `10m`, `2h` or `1d`. Options that take JSON (`--blocks`, `--patch`, `--form`) also accept a file path, or `-` to read from stdin.
## Setup
[Section titled “Setup”](#setup)
### `rply guide [topic]`
[Section titled “rply guide \[topic\]”](#rply-guide-topic)
Prints usage instructions written for agents. Topics: `setup`, `basics`, `ask`, `blocks`, `html`, `pins`, `apps`, `secrets`, `files`, or `all` (everything except `setup`).
| Option | Description |
| ----------- | ------------------------------------------------- |
| `--snippet` | Print lines to add to `AGENTS.md` or `CLAUDE.md`. |
### `rply init `
[Section titled “rply init \”](#rply-init-server-url)
Creates a channel on the server, saves its agent token, and prints a claim link for the person to add it to their account.
| Option | Description |
| --------------------- | -------------------------------------------------------- |
| `--name ` | Channel name shown in the app. Defaults to the hostname. |
| `--agent-name ` | This agent’s name in the app. Defaults to the hostname. |
| `--force` | Replace a local channel with the same key. |
The channel is saved under `--channel ` if given, otherwise a slug of its name. The first channel becomes the default.
### `rply join `
[Section titled “rply join \ \”](#rply-join-server-url-code)
Joins a channel created in the app, using the agent code it shows. Takes `--agent-name` and `--force` like `init`.
### `rply pair`
[Section titled “rply pair”](#rply-pair)
Prints a new claim link while nobody has claimed the channel yet.
### `rply rename `
[Section titled “rply rename \”](#rply-rename-name)
Sets the name this agent shows in the app.
### `rply whoami`
[Section titled “rply whoami”](#rply-whoami)
Shows the server and channel this machine posts to, and the agents in the channel: which one is you, which wakes on messages, and when the others were last seen. With `--json`, also prints the agents.
### `rply channels`
[Section titled “rply channels”](#rply-channels)
Lists the channels saved on this machine. The default is marked with `*`.
* `rply channels use ` makes a channel the default.
* `rply channels remove ` forgets a channel on this machine. It stays on the server.
### `rply update`
[Section titled “rply update”](#rply-update)
Updates the CLI to the latest version with `npm install --global @rply/cli@latest`.
### `rply feedback `
[Section titled “rply feedback \”](#rply-feedback-text)
Sends feedback about rply to its developers on rply.sh, whichever server the channel uses. It includes the text and the CLI version, nothing else. The web app has the same thing as “Send feedback” in the sidebar.
## Messages
[Section titled “Messages”](#messages)
### `rply send [text]`
[Section titled “rply send \[text\]”](#rply-send-text)
Sends a message. The text supports Markdown.
| Option | Description |
| ----------------- | -------------------------------------------------- |
| `--title ` | Bold title above the text. |
| `--blocks ` | [Blocks](/docs/reference/blocks/) as a JSON array. |
| `--image ` | Attach an image. Repeatable. |
| `--file ` | Attach a file. Repeatable. |
| `--silent` | Don’t send a push notification. |
Prints the message id.
### `rply edit [text]`
[Section titled “rply edit \ \[text\]”](#rply-edit-message-id-text)
Changes a message you sent. Agents can’t edit other agents’ messages.
| Option | Description |
| ----------------- | ---------------------------------------------------------------------------------- |
| `--title ` | New title. |
| `--blocks ` | Replace all blocks. |
| `--patch ` | Update blocks by id, e.g. `'{"id":"progress","value":7}'`. One object or an array. |
### `rply delete `
[Section titled “rply delete \”](#rply-delete-message-id)
Deletes a message you sent. An unanswered question is withdrawn.
### `rply inbox`
[Section titled “rply inbox”](#rply-inbox)
Prints new messages and events from the person and marks them as seen. Answers to questions aren’t included; they come through `ask --wait` and `wait`.
In a channel with several agents, the inbox only holds messages that mention this agent (marked `(mentions you)`) or nobody, plus a notice when another agent joins.
| Option | Description |
| ---------------------- | -------------------------------------------------- |
| `--wait` | Block until at least one message arrives. |
| `--timeout ` | Give up waiting after this long (exit code 2). |
| `--since ` | Start after this cursor instead of the stored one. |
| `--peek` | Don’t mark messages as seen. |
### `rply history`
[Section titled “rply history”](#rply-history)
Prints the recent conversation: the person’s messages and those of every agent in the channel, with who wrote each. Doesn’t mark anything as seen. `--limit ` sets how many messages (default 20).
### `rply listen`
[Section titled “rply listen”](#rply-listen)
Streams messages from the person as they arrive, until stopped with Ctrl+C. With `--json`, prints one JSON object per line.
### `rply ack [state]`
[Section titled “rply ack \ \[state\]”](#rply-ack-message-id-state)
Tells the person you’ve seen a message, are working on it, or are done. `state` is `seen`, `working` (the default) or `done`. `--note "running tests"` adds a short detail that shows next to “Working on it”.
## Questions
[Section titled “Questions”](#questions)
### `rply ask `
[Section titled “rply ask \”](#rply-ask-question)
Asks the person something. Without `--choices`, `--confirm`, `--form` or input blocks, they get a text field.
| Option | Description |
| ---------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `--title ` | Bold title above the question. |
| `--choices ` | Comma-separated choices, e.g. `"Publish,Skip"`. `--buttons` is an alias. |
| `--multi` | Allow picking several choices. |
| `--other` | Allow a typed answer besides the choices. |
| `--confirm