logo
icon

OpenAB Pi

Deploy OpenAB with the Pi coding agent as a Discord/Slack bot. Pi is a minimal coding agent (4 tools: read/write/edit/bash) with native subscription auth — Claude Pro/Max, ChatGPT Plus/Pro, or any API key. Supports 15+ LLM providers via mid-session model switching. Source: https://github.com/openabdev/openab

template cover
Deployed1 times
PublisherzeaburZeabur
Created2026-05-27
Tags
AIDiscord BotDeveloper Tools

OpenAB Pi

One-click deployment of OpenAB with the Pi coding agent as the AI backend. Uses the pi-acp Node.js adapter to bridge ACP JSON-RPC ↔ Pi CLI.

Why Pi?

  • Native subscription auth — Claude Pro/Max and ChatGPT Plus/Pro via pi /login. No auth-proxy sidecar needed.
  • Minimal tool surface — 4 tools only (read / write / edit / bash). Maximum context window for actual code.
  • Multi-provider — switch models mid-session. Supports Anthropic, OpenAI, Google, and any OpenAI-compatible endpoint (DeepSeek, Groq, Together, Ollama, etc.).
  • Branching sessions — Pi saves history as trees; explore multiple approaches from one decision point.

Important Notes

  • Image tag: This template tracks the beta tag. To pin a specific version, change the image tag in Zeabur Dashboard → Service → Settings.
  • Persistent storage: /home/node is mounted as a persistent volume. Config, auth tokens (~/.pi/), and session trees survive restarts.
  • Config location: config.toml is generated at /home/node/.config/openab/config.toml on first boot. Edit it directly after that — env vars are only used for initial setup.
  • User home: Pi runs as the node user (UID 1000) — different from other agent templates that use agent. Paths in this template all start with /home/node.

Setup

1. Create a Discord Bot

  1. Go to Discord Developer Portal
  2. Create a new application and add a Bot
  3. Enable Message Content Intent under Privileged Gateway Intents
  4. Copy the bot token and paste it as DISCORD_BOT_TOKEN
  5. Go to OAuth2 → URL Generator → check scope bot → check permissions: Send Messages, Send Messages in Threads, Create Public Threads, Read Message History, Add Reactions, Manage Messages
  6. Invite the bot to your server with the generated URL

2. Authenticate Pi (pick one)

Option A — Claude Pro/Max OAuth token (no interaction needed): Paste your Claude OAuth token (sk-ant-oat01-..., same format as CLAUDE_CODE_OAUTH_TOKEN) into ANTHROPIC_OAUTH_TOKEN. Pi reads it automatically. Done.

Option B — Other API keys (no interaction needed): Open the openab-pi service in Zeabur Dashboard → Variables → add any of these (Pi auto-detects from env):

VariableProvider
ANTHROPIC_API_KEYAnthropic Claude (pay-per-token)
OPENAI_API_KEYOpenAI GPT
GEMINI_API_KEYGoogle Gemini
DEEPSEEK_API_KEY / GROQ_API_KEY / XAI_API_KEY / OPENROUTER_API_KEYOther providers

All keys above are pre-listed in inherit_env and will be passed to Pi automatically.

Option C — Interactive OAuth (/login): After deployment, open the Exec tab and run pi, then inside the interactive UI type /login. Choose provider, complete OAuth in browser. Tokens persist in /home/node/.pi/.

3. Configure Channels (Optional)

Set OPENAB_ALLOWED_CHANNELS to restrict which channels the bot responds in. Leave empty to allow all channels.

Slack Setup (Optional)

  1. Go to https://api.slack.com/apps → Create New App → From scratch
  2. Enable Socket Mode → generate App-Level Token with scope connections:write
  3. Enable Event Subscriptions → add bot events: app_mention, message.channels, message.groups
  4. OAuth & Permissions → add scopes: app_mentions:read, chat:write, channels:history, groups:history, channels:read, groups:read, reactions:write, files:read, users:read
  5. Install App → copy xoxb-... token and xapp-... token

Customization

FileDescription
/home/node/.config/openab/config.tomlOpenAB config (sessions, reactions, etc.)
/home/node/.pi/Pi configuration and auth tokens
/home/node/.pi/sessions/Pi session history trees
/home/node/AGENTS.mdProject-level steering for Pi (loaded into context)
/home/node/.pi/APPEND_SYSTEM.mdAppend to Pi's system prompt
/home/node/.pi/SYSTEM.mdReplace Pi's system prompt entirely

To reset OpenAB config: rm /home/node/.config/openab/config.toml and restart.

Limitations

  • No streamingpi-acp returns the full response at once; intermediate output is buffered.
  • Cancel is best-effortsession/cancel may not interrupt mid-generation; Pi CLI runs to completion.