This is the full developer documentation for rply # Channels, agents and accounts > Who can do what, and how agents and people join a channel. A **channel** is one conversation between you and one or more agents. Agents and people are on different sides of it, with different credentials and different permissions. ## Two sides, two kinds of credentials [Section titled “Two sides, two kinds of credentials”](#two-sides-two-kinds-of-credentials) | | Held by | Can | | ---------------------------- | --------------------------------------------- | ------------------------------------------------------------------------------------------------- | | **Agent token** (`rply_a_…`) | The CLI on the agent’s machine, one per agent | Post as the agent, read your messages to it, keep a status, request secrets | | **Account** | You, signed in to the app | Read and answer every channel you’re a member of, write to agents, provide secrets, manage agents | The split matters because messages from you are instructions to an agent with shell access. If someone gets hold of an agent token, they can read and post as that agent, but they can’t write to it as you. Tokens are stored on the server only as hashes, and their `rply_a_` prefix makes a leaked one easy to spot. ## Accounts [Section titled “Accounts”](#accounts) You sign in with an email and password, or a passkey. On a self-hosted server, the first account to sign up sets the server up and owns it; after that, the server’s registration setting decides who else can sign up. See [Self-hosting](/docs/self-hosting/overview/#the-first-account). Every channel has an **owner**, who can add and revoke agents and delete the channel. ## Joining a channel [Section titled “Joining a channel”](#joining-a-channel) There are two ways to connect an agent, depending on who starts. ### You start: agent codes [Section titled “You start: agent codes”](#you-start-agent-codes) 1. Create a channel in the app with **Add channel**. 2. The app shows a prompt for your agent with a one-time **agent code**. 3. The agent runs `rply join `, 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. ![An app called Rankings with a bar chart, a Re-run audit button and a table of pages](/_astro/app.BD362qHV_21Iqh2.webp) ## 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 ``` ![A question with Publish and Not yet buttons](/_astro/question.ID1x0Kgk_ZcKU7V.webp) 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 ``` ![A question with a red Delete 40 snapshots button](/_astro/confirm.BnJTxwDv_Z1O1zez.webp) ## 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 <id>`. ## 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 <key> 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":"<id from upload>","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 <id> 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 <seq>` | 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`. ![A message from You marked “Working on it”](/_astro/working.BGJaJlUP_1qnOw3.webp) ## 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… '<json>' ``` 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. ![A pinned status with three values and a progress bar](/_astro/status-pin.DJO_Feoz_CYOzE.webp) ## 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. ![The rply web app on a phone-sized screen](/_astro/thread-mobile.zi9r8OCL_ZgdPc0.webp) ## 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: ![A secret request for STRIPE_SECRET_KEY with a masked value field, Send securely and Decline](/_astro/secret.DzJI-t2i_Z20WRmT.webp) 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 <id> --wait`, or withdraw the request with `rply secret cancel <id>`. ## Options [Section titled “Options”](#options) | Option | Effect | | ---------------------- | -------------------------------------------------------------------------------- | | `--to <path>` | 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 <text>` | Why you need it, shown to the person. | | `--expires <duration>` | Stop accepting the secret after e.g. `1h`. Defaults to `--timeout` when waiting. | | `--wait` | Block until the secret is written. | | `--timeout <duration>` | 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 <message-id> --patch '{"id":"crawl","value":42}' ``` Delete a message with `rply delete <message-id>`. 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 <server-url> <code>`, or `hermes rply init <server-url> --name "<channel 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 <code> 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 <name>` 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/<id>?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. ![A question with two choices](/_astro/question.ID1x0Kgk_ZcKU7V.webp) ### `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 <command>`. 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 <key>` | 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 <server-url>` [Section titled “rply init \<server-url>”](#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 <name>` | Channel name shown in the app. Defaults to the hostname. | | `--agent-name <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 <key>` if given, otherwise a slug of its name. The first channel becomes the default. ### `rply join <server-url> <code>` [Section titled “rply join \<server-url> \<code>”](#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 <name>` [Section titled “rply rename \<name>”](#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 <key>` makes a channel the default. * `rply channels remove <key>` 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 <text>` [Section titled “rply feedback \<text>”](#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 <title>` | Bold title above the text. | | `--blocks <json>` | [Blocks](/docs/reference/blocks/) as a JSON array. | | `--image <path>` | Attach an image. Repeatable. | | `--file <path>` | Attach a file. Repeatable. | | `--silent` | Don’t send a push notification. | Prints the message id. ### `rply edit <message-id> [text]` [Section titled “rply edit \<message-id> \[text\]”](#rply-edit-message-id-text) Changes a message you sent. Agents can’t edit other agents’ messages. | Option | Description | | ----------------- | ---------------------------------------------------------------------------------- | | `--title <title>` | New title. | | `--blocks <json>` | Replace all blocks. | | `--patch <json>` | Update blocks by id, e.g. `'{"id":"progress","value":7}'`. One object or an array. | ### `rply delete <message-id>` [Section titled “rply delete \<message-id>”](#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 <duration>` | Give up waiting after this long (exit code 2). | | `--since <seq>` | 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 <n>` 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 <message-id> [state]` [Section titled “rply ack \<message-id> \[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 <question>` [Section titled “rply ask \<question>”](#rply-ask-question) Asks the person something. Without `--choices`, `--confirm`, `--form` or input blocks, they get a text field. | Option | Description | | ---------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | `--title <title>` | Bold title above the question. | | `--choices <list>` | 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 <label>` | A single confirm button. | | `--danger` | Style the choices or confirm button as destructive. | | `--form <json>` | Form fields as a JSON array, asked together. Each field has `name`, `label`, `type` (`text`, `textarea`, `number`, `select`, `toggle`), and optionally `options`, `required`, `placeholder`. | | `--blocks <json>` | Blocks to include. Several input blocks ask several questions at once. | | `--default <value>` | Answer to use if the question expires. Comma-separated with `--multi`. | | `--expires <duration>` | Stop accepting answers after this long. Defaults to `--timeout` when waiting. | | `--wait` | Block until answered and print the answer. | | `--timeout <duration>` | Give up waiting after this long (exit code 2). | With `--wait`, one question prints its answer (strings as-is, other values as JSON); several print a JSON object keyed by block id. With `--json`, it prints `{ status, answers, message_id }`. Without `--wait`, it prints the question’s id. Exit codes: `2` if the question expired without a default or `--timeout` ran out, `3` if it was cancelled. ### `rply wait <message-id>` [Section titled “rply wait \<message-id>”](#rply-wait-message-id) Waits for the answer to an earlier question. Takes `--timeout`. ### `rply asks` [Section titled “rply asks”](#rply-asks) Lists your questions that are still open. ### `rply cancel <message-id>` [Section titled “rply cancel \<message-id>”](#rply-cancel-message-id) Withdraws a question that hasn’t been answered. ## Pins and status [Section titled “Pins and status”](#pins-and-status) ### `rply pin set <key> [text]` [Section titled “rply pin set \<key> \[text\]”](#rply-pin-set-key-text) Creates or replaces the pinned message with this key. Takes `--title`, `--blocks`, `--image` and `--file` like `send`. A pin belongs to the agent that set it first; other agents in the channel use their own keys. ### `rply pin patch <key> [text]` [Section titled “rply pin patch \<key> \[text\]”](#rply-pin-patch-key-text) Updates the pinned message with this key. Takes `--title` and `--patch`. ### `rply pin remove <key>` · `rply pin list` [Section titled “rply pin remove \<key> · rply pin list”](#rply-pin-remove-key--rply-pin-list) Unpins and deletes a pinned message, or lists them. ### `rply status set <text|json>` [Section titled “rply status set \<text|json>”](#rply-status-set-textjson) Replaces the pinned message with key `status`. Takes plain text, a blocks array, `{ "blocks": [...] }`, a file path or `-` for stdin. ### `rply status patch <json>` [Section titled “rply status patch \<json>”](#rply-status-patch-json) Updates status blocks by id. Takes one patch object or an array. ### `rply status get` [Section titled “rply status get”](#rply-status-get) Prints the status message’s body as JSON. ## Apps [Section titled “Apps”](#apps) ### `rply app set <key> <file|url>` [Section titled “rply app set \<key> \<file|url>”](#rply-app-set-key-fileurl) Creates or replaces the app with this key from a single HTML file (or `-` for stdin). Refuses pages whose inline scripts don’t parse. With an `http(s)` URL instead, the app shows that page, e.g. a dev server behind a tunnel (see [Show a running web app](/docs/guides/apps/#show-a-running-web-app)). | Option | Description | | ----------------- | -------------------------------------------- | | `--title <title>` | Title shown in the app. Defaults to the key. | ### `rply app list` · `rply app remove <key>` [Section titled “rply app list · rply app remove \<key>”](#rply-app-list--rply-app-remove-key) Lists apps, or deletes one. ### `rply app commands` [Section titled “rply app commands”](#rply-app-commands) Shows the folder for command scripts and the commands in it. ### `rply app call <name> [args]` [Section titled “rply app call \<name> \[args\]”](#rply-app-call-name-args) Runs a command script the way `rply serve` does, to test it. `args` is JSON. Takes `--dir`. ### `rply serve` [Section titled “rply serve”](#rply-serve) Runs command scripts for apps and wakes the agent when the person writes. | Option | Description | | --------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | `--dir <path>` | Folder with command scripts. Defaults to the one `rply app commands` shows. | | `--on-message <command>` | Shell command that wakes the agent when the person writes. Runs once at a time, in the current directory, with the new messages as JSON on stdin and `RPLY_CHANNEL` set. With several agents in the channel, only for messages that mention this agent or nobody. | | `--on-message-timeout <duration>` | Stop a wake run after this long, `0` for never. Default `1h`. | | `--install` | Install as a background service (systemd or launchd) that restarts on crash and reboot. Remembers the current directory, `PATH` and options. | | `--uninstall` | Stop and remove the background service. | ### `rply respond <call-id> [value]` [Section titled “rply respond \<call-id> \[value\]”](#rply-respond-call-id-value) Answers a `rply.agent` call from an app. `value` is JSON, plain text, or `-` for stdin. | Option | Description | | ------------------- | ------------------------- | | `--error <message>` | Report a failure instead. | ## Files [Section titled “Files”](#files) ### `rply file upload <path>` [Section titled “rply file upload \<path>”](#rply-file-upload-path) Uploads a file and prints its id, for use in `image` and `file` blocks. ### `rply file get <file-id>` [Section titled “rply file get \<file-id>”](#rply-file-get-file-id) Downloads a file the person attached. | Option | Description | | ------------- | ---------------------------------------------------------------- | | `--to <path>` | Where to save it. Defaults to its name in the current directory. | | `--force` | Overwrite an existing file. | ## Secrets [Section titled “Secrets”](#secrets) ### `rply secret request <name>` [Section titled “rply secret request \<name>”](#rply-secret-request-name) Requests a secret. The value is encrypted on the person’s device and only ever written to `--to`. | Option | Description | | ---------------------- | -------------------------------------------------------------------------------- | | `--to <path>` | File to write, e.g. `.env`. | | `--file` | Write the value as the whole file instead of a `NAME=value` line. | | `--reason <text>` | Why you need it, shown to the person. | | `--expires <duration>` | Stop accepting the secret after this long. Defaults to `--timeout` when waiting. | | `--wait` | Block until the secret is written. | | `--timeout <duration>` | Give up waiting after this long (exit code 2). | Prints only the file path. Exit codes: `2` if it expired or timed out, `3` if declined or cancelled. ### `rply secret fetch <id>` [Section titled “rply secret fetch \<id>”](#rply-secret-fetch-id) Writes a requested secret once the person has provided it. Takes `--wait` and `--timeout`. ### `rply secret cancel <id>` [Section titled “rply secret cancel \<id>”](#rply-secret-cancel-id) Withdraws a secret request. # CLI configuration > The config file, environment variables and exit codes. ## Config file [Section titled “Config file”](#config-file) The CLI stores its channels in `~/.config/rply/config.json` (or `$XDG_CONFIG_HOME/rply/config.json`). The file is created with permissions `0600`, since it contains agent tokens. ```json { "default": "seo-bot", "channels": { "seo-bot": { "server": "https://app.rply.sh", "token": "rply_a_…", "channel": "jaempdfnr440qf09", "inbox_cursor": 42 } } } ``` * `default` is the channel commands use without `--channel`. * `inbox_cursor` remembers which messages `rply inbox` has already shown. * Once the agent requests a secret, the channel also stores a `secret_key`, the private key used to decrypt secrets. Next to the config file are: * `commands/<channel>/`, the command scripts for apps * `logs/<channel>.log`, the log of the background service installed with `rply serve --install` * `guide.json` and `update-check.json`, which remember whether the guide hint and update notice were shown ## Environment variables [Section titled “Environment variables”](#environment-variables) | Variable | Description | | --------------------------- | ------------------------------------------------------------------------------------------------------------ | | `RPLY_CHANNEL` | Channel key to use, like `--channel`. | | `RPLY_CONFIG` | Path to the config file. | | `RPLY_SERVER`, `RPLY_TOKEN` | Server URL and agent token. Together, they replace the config file, e.g. in CI. Secrets don’t work this way. | | `RPLY_NO_UPDATE_CHECK` | Set to `1` to skip the daily check for a newer CLI version. | | `RPLY_NO_GUIDE_HINT` | Set to `1` to hide the hint to read `rply guide`. | `rply serve` sets these for the scripts and commands it runs: | Variable | Set for | Description | | ---------------- | ---------------------------------- | ----------------- | | `RPLY_CHANNEL` | Command scripts and `--on-message` | The channel key. | | `RPLY_CALL_NAME` | Command scripts | The command name. | | `RPLY_CALL_ID` | Command scripts | The call’s id. | ## Exit codes [Section titled “Exit codes”](#exit-codes) | Code | Meaning | | ---- | --------------------------------------------------------------------- | | `0` | Success. | | `1` | Error, e.g. a network failure, invalid input, or a missing channel. | | `2` | Timed out, or a question or secret request expired without a default. | | `3` | Cancelled or declined. | ## Output [Section titled “Output”](#output) * Normal output goes to stdout. Notices from rply itself, like the update notice, go to stderr. * `--json` (before the command) prints JSON instead. `rply inbox --json` and `rply listen --json` print one message per line: `{ id, seq, sender, created_at, reply_to, state, enc, body }`. * The QR code for claim links is only printed when stdout is a terminal, so it doesn’t end up in an agent’s context. ## Network behavior [Section titled “Network behavior”](#network-behavior) Long waits are split into requests of up to 55 seconds. The CLI retries through network errors and server errors, so `--wait` commands survive a dropped connection or a server restart. # FAQ > Answers to common questions. ## Is this a remote control for Claude Code? [Section titled “Is this a remote control for Claude Code?”](#is-this-a-remote-control-for-claude-code) No. rply doesn’t mirror sessions or run your agent. Your agent decides when to reach you, through a CLI command, and you answer. It works the same for Claude Code, Codex, any other agent, or a plain shell script. ## Do I need MCP? [Section titled “Do I need MCP?”](#do-i-need-mcp) No. rply is a CLI, so any agent with a shell can use it, and so can cron jobs, git hooks and CI. A remote MCP endpoint for hosted agents without a shell is planned. ## Which agents does it work with? [Section titled “Which agents does it work with?”](#which-agents-does-it-work-with) Anything that can run a shell command: Claude Code, Codex, Cursor, Gemini CLI, OpenClaw, GitHub Copilot, and your own scripts. [Set up your agent](/docs/start/agent-setup/) shows how to wake headless agents when you write to them. ## Does the agent need a public address or webhook? [Section titled “Does the agent need a public address or webhook?”](#does-the-agent-need-a-public-address-or-webhook) No. The CLI only makes outgoing HTTPS requests to the server, and waits use long-polling. It works behind NAT, firewalls and proxies. ## Can the server read my messages? [Section titled “Can the server read my messages?”](#can-the-server-read-my-messages) Messages are stored in plain text, so whoever runs the server can read them: rply on app.rply.sh, or you when you self-host. Secrets requested with `rply secret request` are the exception; they’re encrypted on your device and the server never sees them. Optional end-to-end encryption for whole channels is planned. See [Security](/docs/concepts/security/). ## What does it cost? [Section titled “What does it cost?”](#what-does-it-cost) Self-hosting is free; rply is open source. The hosted app at app.rply.sh is free to start. ## What happens if I don’t answer a question? [Section titled “What happens if I don’t answer a question?”](#what-happens-if-i-dont-answer-a-question) The agent keeps waiting until the question expires or its `--timeout` runs out. If the question has a default, the agent gets the default. Otherwise the command exits with code 2, and the agent can decide what to do. See [Ask questions](/docs/guides/ask-questions/#set-a-deadline-and-a-default). ## Is there a mobile app? [Section titled “Is there a mobile app?”](#is-there-a-mobile-app) A native app for iOS and Android is in progress. Until then, add the web app to your Home Screen for push notifications. See [Get notifications](/docs/guides/notifications/). ## Can several people share a channel? [Section titled “Can several people share a channel?”](#can-several-people-share-a-channel) Not yet. Each channel has one owner today. Sharing channels with a team is planned. ## Where do I report a bug or ask for a feature? [Section titled “Where do I report a bug or ask for a feature?”](#where-do-i-report-a-bug-or-ask-for-a-feature) Open an issue on [GitHub](https://github.com/joshuaKnauber/rply/issues). # HTML embeds and apps > The rply bridge available inside HTML blocks and apps. HTML runs in two places: `html` [blocks](/docs/reference/blocks/#html) inside a message, and [apps](/docs/guides/apps/), which are full-page views under a channel. Both run your HTML in a sandboxed frame and give it the same `rply` object. ```sh rply send "Traffic this week" --blocks '[{"type":"html","label":"Traffic","html":"<div id=chart></div><script>…</script>"}]' rply app set dashboard dashboard.html --title Dashboard ``` The HTML can be a fragment or a full document; the outer `<!doctype>` and `<html>` tags are dropped. ## The sandbox [Section titled “The sandbox”](#the-sandbox) * The frame can run scripts, but it can’t read the app, its storage, or the person’s session. * `localStorage` and cookies aren’t available. Use `rply.storage` instead. * Links to `http(s)` addresses open in a new tab (on a phone, in the browser), never inside the frame. * Embeds grow to fit their content. Set `height` on the block to fix it instead. Apps fill the page. ## The `rply` object [Section titled “The rply object”](#the-rply-object) ### `rply.send(value, label?)` [Section titled “rply.send(value, label?)”](#rplysendvalue-label) Sends an event to the agent, any number of times, for example when someone clicks a bar in a chart. It arrives in `rply inbox`: ```plaintext event "Show Tuesday" from chart in message pweehax515jh7zv2: {"day":"tue"} ``` The app shows it as a short “Sent: Show Tuesday” line. Events never answer a question. ### `rply.reply(value)` [Section titled “rply.reply(value)”](#rplyreplyvalue) Answers the question, when the block is marked `"question": true` and has an `id`. Like any question, only the first answer counts. ```json {"type":"html","id":"pick","question":true,"html":"<button onclick=\"rply.reply('blue')\">Blue</button>"} ``` ### `rply.call(name, args)` → `Promise` [Section titled “rply.call(name, args) → Promise”](#rplycallname-args--promise) Runs the command script `name` on the agent’s machine with `args` as JSON, and resolves with its output. Requires `rply serve` to be running. See [Build an app](/docs/guides/apps/#3-add-command-scripts). ```js const stats = await rply.call("stats", { range: "7d" }); ``` ### `rply.agent(name, args)` → `Promise` [Section titled “rply.agent(name, args) → Promise”](#rplyagentname-args--promise) Asks the agent itself, and resolves with its answer from `rply respond`. Every call becomes a message, so don’t use it for polling. Both `call` and `agent` reject with an `Error` whose message is `offline` (no `rply serve` running), `timeout`, or the error the script or agent reported. ### `rply.storage` [Section titled “rply.storage”](#rplystorage) Small values per person and app, synced across their devices. Both methods are synchronous; values are saved in the background. ```js const tab = rply.storage.get("tab") ?? "week"; rply.storage.set("tab", "month"); ``` Values must be JSON. Each app or message can store up to 256 KB. ### `rply.theme` [Section titled “rply.theme”](#rplytheme) `"light"` or `"dark"`, following the app’s theme rather than the system’s. ## Styling [Section titled “Styling”](#styling) Buttons, inputs, links and tables get default styles that match the app. The page background is transparent. Use these CSS variables, so your HTML works in both themes, instead of hard-coding colors: | Variable | Use | | --------------------------------------------------- | --------------------------------------------- | | `--rply-fg` | Text | | `--rply-muted` | Secondary text | | `--rply-border` | Borders and dividers | | `--rply-surface` | Tinted backgrounds, e.g. buttons | | `--rply-bg` | The app’s background, e.g. for sticky headers | | `--rply-accent` | Links and highlights | | `--rply-success`, `--rply-warning`, `--rply-danger` | Status colors | The theme is set as `data-theme="light"` or `"dark"` on `<html>`. It can change while the page is open; the window then receives a `rply:theme` event. Redraw anything that read colors once, like a canvas chart: ```js addEventListener("rply:theme", () => drawChart()); ``` ## Errors [Section titled “Errors”](#errors) Uncaught errors and rejected promises show the person a banner: “This app hit an error: …”. They can click **Send to agent**, which sends an event to the agent with the value `{ "error": "…" }`. # Configuration > Every environment variable the server reads. The server is configured entirely through environment variables. All of them are optional; a server with none set works for a single person on `localhost`. Sizes accept `B`, `KB`, `MB` or `GB` (e.g. `25MB`). Retention periods accept hours or days (e.g. `12h`, `30d`). ## Basics [Section titled “Basics”](#basics) | Variable | Default | Description | | -------------- | ----------------- | -------------------------------------------------------------------------------------------------- | | `PORT` | `8080` | Port to listen on. | | `RPLY_URL` | | The server’s public address, e.g. `https://rply.example.com`. Needed for passkeys and email links. | | `RPLY_WEB_DIR` | the built web app | Folder with the web app to serve. Only needed for custom builds. | ## Database [Section titled “Database”](#database) | Variable | Default | Description | | ------------------- | ------------------------------------- | --------------------------------------------------------------------------------------------------------------------------- | | `RPLY_DB` | `rply.db` (`/data/rply.db` in Docker) | Path to the SQLite file. | | `RPLY_DATABASE_URL` | | A `postgres://…` URL. When set, it’s used instead of SQLite, and file storage is off unless you set `RPLY_FILES_DIR` or S3. | Migrations run automatically on start. See [Upgrades and backups](/docs/self-hosting/upgrades/). ## Accounts [Section titled “Accounts”](#accounts) | Variable | Default | Description | | ---------------------- | --------- | --------------------------------------------------------------------------------------------------------------------------- | | `RPLY_REGISTRATION` | `invite` | Who can create an account after the first one. `open`: anyone. `invite` and `closed`: nobody, for now; invites are planned. | | `RPLY_AUTH_SECRET` | generated | Secret for signing sessions. Generated on first start and stored in the database if unset. | | `RPLY_TRUSTED_ORIGINS` | | Comma-separated extra origins allowed to sign in, e.g. a separately hosted web app. | ### Email [Section titled “Email”](#email) Email enables verification, password reset and magic links. It’s sent through [Resend](https://resend.com) and needs `RPLY_URL`. | Variable | Description | | --------------------- | ------------------------------------------------------------------- | | `RPLY_RESEND_API_KEY` | Resend API key. | | `RPLY_EMAIL_FROM` | Sender, e.g. `rply <login@example.com>`. Required with the API key. | ### GitHub and Google sign-in [Section titled “GitHub and Google sign-in”](#github-and-google-sign-in) Each provider shows a “Continue with …” button once both of its variables are set. Both need `RPLY_URL`. New accounts still follow `RPLY_REGISTRATION`; signing in with a provider whose verified email matches an existing account links it. | Variable | Description | | ---------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------- | | `RPLY_GITHUB_CLIENT_ID`, `RPLY_GITHUB_CLIENT_SECRET` | A [GitHub OAuth app](https://github.com/settings/developers) with the callback URL `<RPLY_URL>/v1/auth/callback/github`. | | `RPLY_GOOGLE_CLIENT_ID`, `RPLY_GOOGLE_CLIENT_SECRET` | A [Google OAuth client](https://console.cloud.google.com/apis/credentials) (web application) with the redirect URI `<RPLY_URL>/v1/auth/callback/google`. | The mobile app signs in with email and password only for now. Without email, reset a password from the command line; see [Upgrades and backups](/docs/self-hosting/upgrades/#reset-a-password-without-email). ## Files [Section titled “Files”](#files) | Variable | Default | Description | | ------------------------ | ----------------------------- | --------------------------------------------- | | `RPLY_FILES` | on | Set to `off` to disable attachments. | | `RPLY_FILES_DIR` | `files/` next to the database | Folder for uploaded files. | | `RPLY_FILES_MAX_SIZE` | `25MB` | Largest allowed file. | | `RPLY_FILES_TOTAL_LIMIT` | `5GB` | Total storage; uploads beyond it are refused. | | `RPLY_FILES_RETENTION` | off | Delete files older than this, e.g. `30d`. | ### S3-compatible storage [Section titled “S3-compatible storage”](#s3-compatible-storage) Store files in any S3-compatible bucket (AWS, Cloudflare R2, MinIO, Railway buckets) instead of a folder: | Variable | Description | | --------------------------- | --------------------------------------- | | `RPLY_S3_BUCKET` | Bucket name. Setting it switches to S3. | | `RPLY_S3_ENDPOINT` | Endpoint URL. | | `RPLY_S3_ACCESS_KEY_ID` | Access key. | | `RPLY_S3_SECRET_ACCESS_KEY` | Secret key. | | `RPLY_S3_REGION` | Region, default `auto`. | ## Push notifications [Section titled “Push notifications”](#push-notifications) Web push works without configuration: the server generates its keys on first start and stores them in the database. | Variable | Default | Description | | ------------------------------------------------- | ----------------- | ------------------------------------------------------ | | `RPLY_PUSH` | on | Set to `off` to disable push notifications. | | `RPLY_VAPID_PUBLIC_KEY`, `RPLY_VAPID_PRIVATE_KEY` | generated | Use your own key pair. | | `RPLY_VAPID_SUBJECT` | `https://rply.sh` | Contact for push services, a URL or `mailto:` address. | Push services require HTTPS, except on `localhost`. ## Limits and retention [Section titled “Limits and retention”](#limits-and-retention) All of these are off by default. They count per account, across the channels the account owns. | Variable | Description | | ----------------------------- | ----------------------------------------------------- | | `RPLY_LIMIT_CHANNELS` | Most channels an account can own. | | `RPLY_LIMIT_MESSAGES_PER_DAY` | Most new messages per account in 24 hours. | | `RPLY_LIMIT_STORAGE` | Most file storage per account, e.g. `1GB`. | | `RPLY_MESSAGE_RETENTION` | Delete unpinned messages older than this, e.g. `90d`. | Some limits are always on to protect the server, whatever you configure: 120 writes a minute per channel, 20 agents per channel, and 20 channels created without an account per IP address per hour. # Docker and any server > Run rply with Docker on any Linux server, with Caddy for HTTPS. This guide runs rply on a server you control, such as a VPS from Hetzner or DigitalOcean, with Caddy providing HTTPS. You need Docker, a domain pointing at the server, and ports 80 and 443 open. ## 1. Build the image [Section titled “1. Build the image”](#1-build-the-image) ```sh git clone https://github.com/joshuaKnauber/rply cd rply docker build -t rply . ``` ## 2. Run the container [Section titled “2. Run the container”](#2-run-the-container) ```sh docker run -d --name rply --restart always \ -p 127.0.0.1:8080:8080 \ -v rply-data:/data \ -e RPLY_URL=https://rply.example.com \ rply ``` * `-v rply-data:/data` keeps the database and files in a Docker volume across restarts and upgrades. * Binding to `127.0.0.1` keeps the plain-HTTP port private; Caddy serves the public side. Check it’s up: ```sh curl http://localhost:8080/health ``` ```json {"ok":true} ``` ## 3. Add HTTPS with Caddy [Section titled “3. Add HTTPS with Caddy”](#3-add-https-with-caddy) [Install Caddy](https://caddyserver.com/docs/install), then run: ```sh caddy reverse-proxy --from rply.example.com --to localhost:8080 ``` For a permanent setup, put this in `/etc/caddy/Caddyfile` and reload Caddy: Caddyfile ```text rply.example.com { reverse_proxy localhost:8080 } ``` Caddy gets a certificate automatically. Open `https://rply.example.com` and create the first account. ## Docker Compose [Section titled “Docker Compose”](#docker-compose) The same setup as a Compose file, including Caddy: compose.yaml ```yaml services: rply: build: https://github.com/joshuaKnauber/rply.git restart: always environment: RPLY_URL: https://rply.example.com volumes: - rply-data:/data caddy: image: caddy:2 restart: always ports: - "80:80" - "443:443" command: caddy reverse-proxy --from rply.example.com --to rply:8080 volumes: - caddy-data:/data volumes: rply-data: caddy-data: ``` ```sh docker compose up -d ``` ## Running it locally [Section titled “Running it locally”](#running-it-locally) To try rply on your laptop, skip Caddy and open `http://localhost:8080`: ```sh docker run -d --name rply -p 8080:8080 -v rply-data:/data rply ``` Only your computer can reach it, so your phone won’t get notifications. Browsers allow push on `localhost`, so notifications in that browser still work. ## Next steps [Section titled “Next steps”](#next-steps) * [Configuration](/docs/self-hosting/configuration/) lists every environment variable. * [Upgrades and backups](/docs/self-hosting/upgrades/) covers updating and restoring. # exe.dev > Run the server on the same exe.dev VM as your agent. If your agent already runs on an [exe.dev](https://exe.dev) VM, the server can run right next to it. exe.dev provides HTTPS for the VM through its proxy, so there’s nothing else to set up. ## 1. Build and run the server on the VM [Section titled “1. Build and run the server on the VM”](#1-build-and-run-the-server-on-the-vm) On the VM: ```sh git clone https://github.com/joshuaKnauber/rply cd rply docker build -t rply . docker run -d --name rply --restart always \ -p 8080:8080 \ -v rply-data:/data \ -e RPLY_URL=https://<vm>.exe.xyz \ rply ``` Replace `<vm>` with your VM’s name. ## 2. Make it public [Section titled “2. Make it public”](#2-make-it-public) From your own computer, point exe.dev’s HTTPS proxy at port 8080 and make it public: ```sh ssh exe.dev share port <vm> 8080 ssh exe.dev share set-public <vm> ``` The server is now at `https://<vm>.exe.xyz`. It has to be public so your phone and browser can reach it; rply’s own accounts protect it. Note exe.dev only makes one port per VM public. If something else already uses it, run rply on a different VM or [another platform](/docs/self-hosting/overview/#pick-a-platform). ## 3. Connect the agent [Section titled “3. Connect the agent”](#3-connect-the-agent) Open `https://<vm>.exe.xyz`, create the first account, then connect the agent on the same VM: ```sh npm install --global @rply/cli rply init https://<vm>.exe.xyz --name "SEO bot" ``` Open the claim link it prints, and continue with [Set up your agent](/docs/start/agent-setup/). ## Let the agent do it [Section titled “Let the agent do it”](#let-the-agent-do-it) An agent on the VM can do all of the above itself. Use the **exe.dev** option in the Get started section on [rply.sh](https://rply.sh) to copy a prompt for it. You’ll still run the two `ssh exe.dev share` commands, or give the agent a way to run them. # Fly.io and Render > Deploy rply on Fly.io or Render. Both platforms build the repository’s `Dockerfile` and provide HTTPS. The one thing to get right is persistent storage at `/data`. ## Fly.io [Section titled “Fly.io”](#flyio) You need [flyctl](https://fly.io/docs/flyctl/install/) and a Fly.io account. ### 1. Create the app [Section titled “1. Create the app”](#1-create-the-app) ```sh git clone https://github.com/joshuaKnauber/rply cd rply fly launch --no-deploy ``` `fly launch` detects the `Dockerfile` and writes a `fly.toml`. Pick a name and region when it asks. ### 2. Add a volume and the URL [Section titled “2. Add a volume and the URL”](#2-add-a-volume-and-the-url) ```sh fly volumes create rply_data --size 1 fly secrets set RPLY_URL=https://<app>.fly.dev ``` ### 3. Mount the volume [Section titled “3. Mount the volume”](#3-mount-the-volume) Add this to `fly.toml`: fly.toml ```toml [mounts] source = "rply_data" destination = "/data" ``` ### 4. Deploy [Section titled “4. Deploy”](#4-deploy) ```sh fly deploy ``` Open `https://<app>.fly.dev` and create the first account. Keep the app at one machine; a volume belongs to a single machine, and rply runs as a single instance. ## Render [Section titled “Render”](#render) Render’s persistent disks need a paid instance type. 1. Create a **New Web Service** from the `joshuaKnauber/rply` repository (or your fork) and choose the **Docker** runtime. 2. Add a **Persistent Disk** with the mount path `/data`. 3. Under **Environment**, set `RPLY_URL` to the service’s URL, e.g. `https://rply.onrender.com`. 4. Set the health check path to `/health`. When the deploy finishes, open the URL and create the first account. ## Next steps [Section titled “Next steps”](#next-steps) * [Configuration](/docs/self-hosting/configuration/) for registration, email and storage. * [Upgrades and backups](/docs/self-hosting/upgrades/). # Self-hosting > Run your own rply server: what you need and how to choose where. rply is open source, and the server is one Docker container. Running your own means your messages live on your machine and nobody else can read them. The web app comes with the server, so there’s nothing else to deploy. Just want to try rply? The hosted app at [app.rply.sh](https://app.rply.sh) is free to start and works the same way. Self-hosting is for when you want to own the data. ## What you run [Section titled “What you run”](#what-you-run) * **One container** built from the repository’s `Dockerfile`. It serves the API and the web app on port `8080`. * **SQLite** in `/data/rply.db`, plus uploaded files in `/data/files`. Mount `/data` on a persistent volume, or you’ll lose everything on the next deploy. * **Postgres** instead of SQLite is supported for larger setups; see [Configuration](/docs/self-hosting/configuration/#database). Run one instance. SQLite and the server’s in-memory wait queue assume a single process. ## Requirements [Section titled “Requirements”](#requirements) * Somewhere to run a Docker container with a persistent volume. * **HTTPS** on a public address, so your phone can reach it and the browser allows push notifications and passkeys. Most platforms provide this; on a plain server, put Caddy in front. * Set `RPLY_URL` to the public address, e.g. `https://rply.example.com`. It’s needed for passkeys and email links. The server checks itself at `/health`, which platforms can use as a health check. ## The first account [Section titled “The first account”](#the-first-account) When you open a new server, it asks you to create an account. **The first account sets up the server and owns it.** After that, nobody else can sign up by default. To let others register, set `RPLY_REGISTRATION=open`; see [Configuration](/docs/self-hosting/configuration/#accounts). ## Pick a platform [Section titled “Pick a platform”](#pick-a-platform) | Platform | Good for | | ------------------------------------------------------- | --------------------------------------------------------------- | | [exe.dev](/docs/self-hosting/exe-dev/) | Running the server on the same VM as your agent | | [Railway](/docs/self-hosting/railway/) | The least setup: deploy from GitHub, add a volume | | [Fly.io or Render](/docs/self-hosting/other-platforms/) | Managed platforms you may already use | | [Docker on any server](/docs/self-hosting/docker/) | A VPS from Hetzner, DigitalOcean or anyone else, or your laptop | ## Let your agent do it [Section titled “Let your agent do it”](#let-your-agent-do-it) An agent with a shell can deploy the server for you. The **Get started** section on [rply.sh](https://rply.sh) has a setup prompt for each platform: the agent deploys the server, you create the first account, and it connects itself to a channel. ## After deploying [Section titled “After deploying”](#after-deploying) 1. Open your server’s URL and create the first account. 2. Create a channel with **Add channel**, and give your agent the prompt the app shows. Or run `rply init https://your-server --name "…"` and open the claim link. 3. Turn on notifications with the bell in the sidebar. # Railway > Deploy rply on Railway with a volume and a domain. Railway builds the repository’s `Dockerfile` and gives you HTTPS out of the box. You need a Railway account. ## 1. Deploy from GitHub [Section titled “1. Deploy from GitHub”](#1-deploy-from-github) 1. In Railway, create a **New Project** and choose **Deploy from GitHub repo**. 2. Enter `joshuaKnauber/rply`, or your fork of it. Railway detects the `Dockerfile` and starts building. ## 2. Add a volume [Section titled “2. Add a volume”](#2-add-a-volume) The database and files live in `/data`. Without a volume they’re lost on every deploy. 1. Open the service and add a **Volume**. 2. Set the mount path to `/data`. ## 3. Add a domain [Section titled “3. Add a domain”](#3-add-a-domain) 1. In the service’s **Settings**, under **Networking**, click **Generate Domain** (or add your own). 2. Under **Variables**, set `RPLY_URL` to that address, e.g. `https://rply-production.up.railway.app`. Railway redeploys with the new variable. ## 4. Check the deploy [Section titled “4. Check the deploy”](#4-check-the-deploy) Set the health check path to `/health` in the service settings, so Railway only switches to a new deploy once it’s up. Then open the domain and create the first account. Note Run a single replica. rply uses SQLite and keeps open waits in memory, so several replicas would each see a different database. ## Infrastructure as code [Section titled “Infrastructure as code”](#infrastructure-as-code) The repository includes `.railway/railway.ts`, which declares the service, the Dockerfile build, the health check and the `/data` volume. With the Railway CLI, apply it with: ```sh railway config plan railway config apply ``` Set `RPLY_URL` and generate the domain in the dashboard, since they aren’t managed by the config. ## Next steps [Section titled “Next steps”](#next-steps) * [Configuration](/docs/self-hosting/configuration/) for registration, email and storage. * [Upgrades and backups](/docs/self-hosting/upgrades/). # Upgrades and backups > Update the server and keep your data safe. ## Update the server [Section titled “Update the server”](#update-the-server) Pull the latest code, rebuild the image, and replace the container. With Docker: ```sh cd rply git pull docker build -t rply . docker stop rply && docker rm rply docker run -d --name rply --restart always \ -p 127.0.0.1:8080:8080 -v rply-data:/data \ -e RPLY_URL=https://rply.example.com rply ``` With Compose, run `docker compose up -d --build`. On Railway, Fly.io and Render, redeploy from the latest commit. Your data lives in the `/data` volume, so it’s kept across updates. ## Database migrations [Section titled “Database migrations”](#database-migrations) The server updates its database schema automatically when it starts. Migrations only move forward. Before applying new migrations to an SQLite database, the server copies it to `rply.db.bak-<version>` next to the original, named after the last migration that was already applied. If an upgrade goes wrong, stop the server, put that copy back in place of `rply.db`, and run the previous version again. With Postgres, rely on your provider’s backups; the server doesn’t copy the database itself. ## Back up your data [Section titled “Back up your data”](#back-up-your-data) Everything is in `/data`: * `rply.db`, the SQLite database (plus `rply.db-wal` and `rply.db-shm` while it runs) * `files/`, uploaded attachments For a consistent copy of a running database, use SQLite’s backup instead of copying the file: ```sh docker exec rply node -e "new (require('node:sqlite').DatabaseSync)('/data/rply.db').exec(\"VACUUM INTO '/data/backup.db'\")" docker cp rply:/data/backup.db ./rply-backup.db docker cp rply:/data/files ./rply-files ``` To restore, stop the server, copy the database to `/data/rply.db` and the files to `/data/files`, and start it again. ## Reset a password without email [Section titled “Reset a password without email”](#reset-a-password-without-email) Without email configured, reset a password from the server’s command line. It prints a new password and signs the account out everywhere: ```sh docker exec rply node packages/server/src/reset-password.ts you@example.com ``` ## Remove an account [Section titled “Remove an account”](#remove-an-account) To delete an account and every channel it owns, for example after abuse: ```sh docker exec rply node packages/server/src/delete-user.ts someone@example.com ``` People can also delete their own account under **Settings** in the app. # Set up your agent > Teach your agent to use rply and get woken up when you write to it. Once an agent is set up, it reports to you on its own, asks when a decision is yours, and starts working when you send it a message, even when nobody has a session open. ## The short way: give your agent the setup prompt [Section titled “The short way: give your agent the setup prompt”](#the-short-way-give-your-agent-the-setup-prompt) The quickest setup is to let the agent do it. Paste this into Claude Code, Codex or any agent with a shell: ```text Connect yourself to rply (https://rply.sh) so you can send me updates and ask me questions. If you're Hermes Agent, use the rply plugin instead of the CLI: - hermes plugins install rply-platform --enable - hermes rply init https://app.rply.sh --name "<a name for you>" - Show me the claim link it prints, then run hermes gateway restart (or hermes gateway install if the gateway isn't installed yet). Otherwise: 1. Install the CLI: npm install --global @rply/cli 2. Create your channel: rply init https://app.rply.sh --name "<a name for you>" Show me the claim link it prints and wait until I've opened it and signed in. 3. Run rply guide setup and follow it from step 3. ``` The same prompt is behind the **Copy setup prompt** button on [rply.sh](https://rply.sh). If you created the channel in the app instead, the app shows a prompt with a one-time agent code; the agent runs `rply join` (or `hermes rply join`) with it instead of `rply init`. Agents with an [integration](/docs/integrations/), like Hermes Agent, connect through it instead of the CLI, which is why the prompt has a separate branch for them. The rest of this page explains what the agent does, so you can do it by hand or check its work. ## What `rply guide setup` walks through [Section titled “What rply guide setup walks through”](#what-rply-guide-setup-walks-through) `rply guide setup` prints a checklist written for agents. The steps are: ### 1. Install the CLI globally [Section titled “1. Install the CLI globally”](#1-install-the-cli-globally) ```sh npm install --global @rply/cli ``` Use a global install rather than `npx`. The background service in step 5 needs a stable path to the `rply` command. ### 2. Connect to a channel [Section titled “2. Connect to a channel”](#2-connect-to-a-channel) Either join a channel you created in the app, using the agent code it shows: ```sh rply join https://app.rply.sh K7QX-M2PD --agent-name "seo-bot" ``` or create one and send you the claim link: ```sh rply init https://app.rply.sh --name "SEO bot" --agent-name "seo-bot" ``` `--agent-name` is how this agent appears in the channel’s agent list. It defaults to the machine’s hostname. ### 3. Learn the commands and remember them [Section titled “3. Learn the commands and remember them”](#3-learn-the-commands-and-remember-them) The agent reads the full guide with `rply guide all`, then adds a short instructions block to the file its future sessions read, such as `AGENTS.md` or `CLAUDE.md`: ```sh rply guide --snippet >> AGENTS.md ``` The snippet looks like this: ```md ## Talking to the human (rply) This agent reports to its human through the `rply` CLI. Run `rply guide` once per session before using it. - Send progress with `rply send`, keep `rply status` up to date, and check `rply inbox` for new instructions. - Ask with `rply ask ... --wait` when a decision is the human's. - Request credentials with `rply secret request`, never through messages. - To let the human try a running web app (e.g. a dev server), see `rply guide previews`; ask them how to expose it first. - When you were started because of new rply messages, run `rply inbox` first and answer through rply. - If `rply` is missing, reinstall it with `npm install --global @rply/cli` (the package is @rply/cli, not rply). - If an rply integration for your agent framework is installed (a plugin or messaging platform), follow its instructions where they differ from these. ``` ### 4. Pick a wake command [Section titled “4. Pick a wake command”](#4-pick-a-wake-command) Most agents don’t run all the time. rply starts the agent when you write to it, using one shell command that runs the agent headless in its project. For example: ```sh # Claude Code claude -p "You have new messages in rply. Run rply inbox and handle them." # Codex codex exec "You have new messages in rply. Run rply inbox and handle them." ``` Use your agent’s non-interactive mode, with permissions that let it work unattended, and run the command once by hand to check it works. ### 5. Install the background service [Section titled “5. Install the background service”](#5-install-the-background-service) From the agent’s project directory: ```sh cd ~/projects/acme-seo rply serve --install --on-message 'claude -p "You have new messages in rply. Run rply inbox and handle them."' ``` This installs `rply serve` as a background service (systemd on Linux, launchd on macOS) that restarts on crash and reboot. It does two things: * **Wakes the agent.** When you write, it runs the `--on-message` command in the project directory, with the new messages as JSON on stdin. It runs one at a time; messages that arrive during a run trigger one more run afterwards. Runs stop after an hour by default; raise that with `--on-message-timeout 4h`, or `0` for no limit. * **Runs command scripts for apps.** See [Build an app](/docs/guides/apps/). If the channel has other agents, they can all use `--on-message`: each is woken for messages that mention it or nobody (see [Several agents in one channel](/docs/guides/channels/#several-agents-in-one-channel)). Remove the service with `rply serve --uninstall`. Caution Don’t start the agent in the background from the wake command. Runs would overlap. If runs take longer than an hour, raise `--on-message-timeout` instead. ### 6. Check that it works [Section titled “6. Check that it works”](#6-check-that-it-works) The agent sends a test message: ```sh rply send "Setup done. Reply to this message to check I get woken up." ``` Reply in the app. If the agent is woken and answers, the setup is complete. ## Troubleshooting [Section titled “Troubleshooting”](#troubleshooting) * **Nothing happens when you reply.** Check the service log at `~/.config/rply/logs/<channel>.log` (next to your config file). Make sure the wake command works when you run it by hand from the project directory. * **No service manager** (some containers and sandboxes). Run `rply listen` in a long-running process instead. It prints your messages as they arrive. * **The agent can’t do something.** A good setup prompt tells the agent to say so with `rply send` rather than pretend. Fix the permissions and run `rply guide setup` again. ## Next steps [Section titled “Next steps”](#next-steps) * [Take instructions from the app](/docs/guides/instructions/) covers the inbox and acknowledgements in detail. * [Use several channels](/docs/guides/channels/) if one machine runs several agents. # Introduction > What rply is, how the pieces fit together, and where to start. rply lets your AI agents reach you. An agent runs a command, and you get a push notification on your phone or laptop. It can send you updates, ask you a question and wait for the answer, keep a live status at the top of the chat, and ask you for an API key without ever seeing it. You can also write to the agent at any time to give it new work. ![The rply web app showing a conversation with an SEO agent: a file, a chart, a pinned status and an open question](/_astro/thread.Dc60An-I_Z2mQ7nF.webp) ## How it works [Section titled “How it works”](#how-it-works) There are three parts: * **The `rply` CLI** runs on the agent’s machine. Any agent that can run a shell command can use it: Claude Code, Codex, Cursor, Gemini CLI, OpenClaw, or your own scripts, cron jobs and CI. * **The server** stores the conversations and relays messages. Use the hosted one at [app.rply.sh](https://app.rply.sh) or [run your own](/docs/self-hosting/overview/). * **The apps** are where you read and answer. The web app works in any browser and can send push notifications. A mobile app is on the way. Each agent gets a **channel**, a conversation between you and that agent. An agent that waits for your answer just blocks on a command such as `rply ask "Publish?" --choices Publish,"Not yet" --wait` and continues when you tap a button. ## What rply isn’t [Section titled “What rply isn’t”](#what-rply-isnt) * It’s not a remote control for one coding agent. rply doesn’t mirror sessions or run your agent; your agent decides when to reach you. * It doesn’t host agents. Your agent runs wherever it already runs: your laptop, a VPS, exe.dev or CI. ## Where to start [Section titled “Where to start”](#where-to-start) * **[Quickstart](/docs/start/quickstart/):** connect an agent and answer its first question in five minutes. * **[Set up your agent](/docs/start/agent-setup/):** make it use rply on its own and wake up when you write to it. * **[Guides](/docs/guides/send-updates/):** recipes for updates, questions, status, secrets, files and apps. * **[Self-hosting](/docs/self-hosting/overview/):** run the server yourself. Reading this as an agent? Run `rply guide` instead. It prints the same information as short, copyable instructions for the version of the CLI you have installed. The whole documentation is also available as plain text at [/llms.txt](/llms.txt). # Quickstart > Connect an agent to app.rply.sh and answer its first question in five minutes. In this tutorial you connect your terminal to the hosted app at app.rply.sh, send yourself a message, and answer a question from the app. Afterwards, [Set up your agent](/docs/start/agent-setup/) shows how to hand the same setup to an agent. You need Node.js 20 or newer and a browser. Everything else is installed along the way. ## 1. Install the CLI [Section titled “1. Install the CLI”](#1-install-the-cli) ```sh npm install --global @rply/cli ``` This installs the `rply` command. Check it with `rply --version`. ## 2. Create a channel [Section titled “2. Create a channel”](#2-create-a-channel) A channel is the conversation between you and one agent. Create one on app.rply.sh: ```sh rply init https://app.rply.sh --name "My first agent" ``` The CLI prints a link: ```plaintext Created channel "My first agent" on https://app.rply.sh, saved as "my-first-agent" (default) Give your human this link to add the channel to their rply account (within 60 minutes, single use): https://app.rply.sh/claim?c=6A7P-NS11 or they enter code 6A7P-NS11 under Add channel > From the agent ``` Open the link and sign up or sign in. The channel is added to your account and appears in the sidebar. Note The link works once and expires after an hour. If it expired, run `rply pair` for a new one. A channel nobody claims is deleted after 24 hours. ## 3. Send a message [Section titled “3. Send a message”](#3-send-a-message) ```sh rply send "Hello from my terminal" ``` The message shows up in the app right away. Messages support Markdown, so `rply send "Deployed **3** new pages"` works too. ## 4. Ask a question [Section titled “4. Ask a question”](#4-ask-a-question) ```sh rply ask "Ship the release?" --choices Ship,Wait --wait ``` The command waits. In the app, the question has buttons: ![A question in the app with Publish and Not yet buttons](/_astro/question.ID1x0Kgk_ZcKU7V.webp) Tap one, and the command prints your answer and exits: ```plaintext Ship ``` That’s the loop at the core of rply: the agent asks, waits, and carries on with your answer. ## 5. Write to the agent [Section titled “5. Write to the agent”](#5-write-to-the-agent) Type a message into the box at the bottom of the channel, for example “Also update the changelog”. Then read it from the terminal: ```sh rply inbox ``` ```plaintext [10/13/2026, 9:20:11 AM] (90rsxg78rg81gzfx) Also update the changelog Acknowledge with: rply ack <id> working|done ``` ## 6. Turn on notifications [Section titled “6. Turn on notifications”](#6-turn-on-notifications) Click the bell at the top of the sidebar and allow notifications. From now on, new messages and questions notify you even when the tab is closed. On iPhone, add the app to your Home Screen first. See [Get notifications](/docs/guides/notifications/). ## Next steps [Section titled “Next steps”](#next-steps) * [Set up your agent](/docs/start/agent-setup/) so it uses rply on its own and wakes up when you write to it. * [Ask questions](/docs/guides/ask-questions/) covers forms, defaults and timeouts. * [Keep a live status](/docs/guides/live-status/) pins an overview to the top of the chat.