pi-bots0.6.1
Turn any Pi session into an addressable bot.
Untested on omp
This is a pi package. No one has reported whether it works on omp yet. If you try it, add your result below.
Reports 0
No reports yet.
Readme
Pi Bots π€
Turn any Pi session into an addressable bot.
Talk to your Pi agents from GitHub issues, pull requests, discussions and comments. Send tasks, receive replies and respond with reactions.
| GitHub conversation | |
|---|---|
| You | @reviewer Review this PR and post your findings. |
| Pi Bots | π Confirmed delivery |
| Agent | Found a redundant validation step. Should I remove it? |
| You | π |
| Pi | Receives your reaction and the agent's original reply. |
Illustrative conversation after /bot @reviewer, with an authorized sender
and a registered agent reply. No separate bot account, webhook server or orchestration framework.
Quick start
Requires Pi 1.7+, Node.js (24 used in CI) and GitHub CLI (gh) authenticated to
github.com with access to the repositories you want to monitor.
1. Install
pi install npm:pi-bots
Alternatively: pi install git:github.com/boadij/pi-bots.
2. Activate
Open Pi in a GitHub repository and run:
/bot
On first activation, Pi Bots discovers the current repository, derives the
handle from the verified bot account's login (for example, @octocat), and
authorizes your normal CLI identity as the default sender. These defaults are
saved; use /bot @reviewer for an explicit handle. If the normal CLI identity
cannot be verified, choose authorized senders in /bot-config.
GitHub writes are enabled by default, including on upgrade from versions
without writes. Disable GitHub writes in /bot-config for read-only
listening (this does not restrict the agent's other tools).
3. Send a task
Publish a PR comment using the handle reported by Pi:
@octocat Review the changes and reply here with your findings.
Keep Pi running. New listeners accept new requests after activation, not old messages. Requests queue until Pi is idle.
Address your bots
| Action | Example |
|---|---|
| Mention | Write @reviewer Review this PR. |
| Apply a label | Apply the exact label @builder to an issue or PR to send its title and original body, without a mention. |
| Edit | Revise a published message containing the handle to send updated instructions if the edit is verifiable. |
| React | Add π to an eligible post or a registered reply from the listener. |
| GitHub source | Body | Title | Label | ReactionΒΉ |
|---|---|---|---|---|
| Issues and pull requests | β | β | β | β |
| Issue and PR conversation comments | β | β | ||
| Submitted PR reviews and published inline review comments | β | β | ||
| Discussions, comments and replies | β | β |
ΒΉ Reactions require a tracked target with its own matching mention (body or supported title), or an unchanged registered reply belonging to the same session and handle. A prior label or parent title alone does not qualify.
Handles are literal and case-sensitive, with token boundaries in titles and bodies; even quoted handles and code blocks can trigger requests. Labels must match exactly. Editing a message with the handle or reapplying a label can send another request. Removing a label does not cancel a request, and leaving it applied does not subscribe the thread to future edits.
Receipts, replies and reactions
In Pi: GitHub requests show as compact cards (for example,
@octocat Β· owner/repo #42 Β· issue comment Β· publication). Left-click a card in
Pi's fullscreen UI to expand just that request, or use Pi's global expand
shortcut (Ctrl+O by default). If the session has not yet saved a transcript,
the request appears as an ordinary user message so Pi can save the first turn.
Once the transcript exists, later requests use cards.
For virtual models, Pi routes the first request of a card-triggered turn as
continuation and the ordinary-message fallback as user. A router that uses
this distinction may choose a different physical model or thinking level,
which can affect capability and cost. A directly selected physical model is
unaffected by this distinction. Pi Bots does not override routing.
π Delivery receipt: Pi Bots ensures eyes are present after Pi history
confirms delivery, not task completion. An existing reaction may be manual
or from an earlier delivery. For optional receipt labels, create
pi-bots:received:reviewer on GitHub and enter the suffix reviewer in the
Receipt label setting. Labels apply only to issues and PRs; Pi Bots never
creates them.
Replies: Ask your agent to reply in the conversation. The bot_reply
tool accepts a GitHub conversation URL and Markdown body. In native Code Mode:
return await tools.bot_reply({
thread: "https://github.com/owner/repo/pull/42",
body: "Found a redundant validation step. Should I remove it?"
});
The agent chooses when to call the tool. It requires an active, verified, saved session with writes enabled, an allowed destination and tool permission. It works through ordinary Pi tool calls or permitted Code Mode, without Bash or Pi Herdsman. Do not mention the sending listener's own handle in a reply. If publication is uncertain, inspect GitHub before retrying.
Reactions: π π π π π β€οΈ π from authorized senders on eligible targets become incoming messages containing the reaction, actor and original target Markdown. The agent interprets their meaning; Pi Bots does not assign workflow actions to emojis. π never triggers a request. Disabling writes disables receipts and replies, not incoming reactions.
Run multiple bots
Give independent Pi sessions their own handles:
| Pi session | GitHub request |
|---|---|
/bot @planner |
@planner Design the authentication flow. |
/bot @builder |
@builder Implement the approved design. |
/bot @reviewer |
@reviewer Review the implementation. |
Each session has its own context, listener and inbox. Handles can be reused across repositories; listeners with the same handle and overlapping scopes can each receive a matching request. A handle does not configure the agent's model, tools, permissions or instructions. The default login can also match ordinary GitHub mentions of that user; use distinct explicit handles for specialized sessions.
Forward original requests
Pi receives source metadata, original Markdown and a stable absolute path, for example:
/home/user/.pi/agent/pi-bots/files/authentication-flow.md
Forward the artifact itself through your existing delegation mechanism instead of reconstructing its contents. Treat it as read-only.
Commands and settings
| Command | Action |
|---|---|
/bot [handle] |
Activate or resume; bare command uses saved handle or verified bot login |
/bot-config |
Open settings |
/bot-inbox |
Inspect and manage unresolved requests |
/bot-status |
Show status, configuration and diagnostics |
/bot-stop |
Pause monitoring and delivery |
Type /bot to discover these native slash commands. Management commands take
no arguments. Use /bot-status instead of bare /bot for inspection; the
former /bot config, /bot inbox and /bot stop arguments are rejected.
Use /bot-config in interactive Pi to configure repositories, senders,
sources, threads, polling and writes. Return to the main list and press
Ctrl+S to save; Esc cancels a field edit or closes the list (with
confirmation for unsaved changes).
The handle, communication account and authorized senders are independent:
| Setting | Example | Meaning |
|---|---|---|
| Handle | @reviewer |
How to address the session |
| GitHub account | review-bot |
Credential used to read GitHub and publish receipts/replies |
| Authorized senders | developer |
Who may send requests |
Choose a stored GitHub CLI account or normal CLI credentials. The Global default account applies to new bots; existing bots can explicitly copy it. This never switches your normal CLI account or grants sender authorization. If quick activation cannot verify the normal CLI sender, choose an authorized sender explicitly in settings.
What to expect
- Polling: Defaults to 30 seconds; nested reviews and discussions target
five-minute scans. Old undiscovered targets and removed reactions may be
missed. Check
/bot-statusfor degraded coverage or write diagnostics. - Persistence: Resume the same saved Pi session to restore its listener. Forks start inactive. Pausing preserves the backlog; resuming can catch up on verifiable requests.
- Recovery: Unverifiable actions are skipped. Uncertain deliveries require
inspection in
/bot-inbox; requests over 128 KiB are stored but not automatically delivered. Receipt is not exactly-once execution. - Trust: Authorized incoming text remains external content.
See behavior and recovery for precise addressing rules, account settings, troubleshooting, storage and upgrade notes. The reference also ships with the npm package containing this README. If the relative link is unavailable, read the reference on GitHub.
Develop
npm ci
npm run check
npm pack --dry-run
git diff --check