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
展開済み0
発行者zeaburZeabur
作成日2026-05-27
タグ
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

Pi authentication is interactive. After deployment, open the Exec tab in Zeabur Dashboard and run:

pi

Inside Pi's interactive UI, type:

/login

Choose your provider and follow the OAuth flow in your browser. Tokens persist in /home/node/.pi/.

For pay-per-token API keys instead of subscription:

pi
# then inside Pi:
/set OPENAI_API_KEY sk-...
# or
/set ANTHROPIC_API_KEY sk-ant-...

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.