Skip to content
rply.shDocs

Set up your agent

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 quickest setup is to let the agent do it. Paste this into Claude Code, Codex or any agent with a shell:

Connect yourself to rply (https://rply.sh) so you can send me updates and ask me questions.
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. 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 with it instead of rply init.

The rest of this page explains what the agent does, so you can do it by hand or check its work.

rply guide setup prints a checklist written for agents. The steps are:

Terminal window
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.

Either join a channel you created in the app, using the agent code it shows:

Terminal window
rply join https://app.rply.sh K7QX-M2PD --agent-name "seo-bot"

or create one and send you the claim link:

Terminal window
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.

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:

Terminal window
rply guide --snippet >> AGENTS.md

The snippet looks like this:

## 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.
- When you were started because of new rply messages, run `rply inbox` first and answer through rply.

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:

Terminal window
# 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.

From the agent’s project directory:

Terminal window
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.

Only one agent per channel should use --on-message. Remove the service with rply serve --uninstall.

The agent sends a test message:

Terminal window
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.

  • 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.