setup command walks you through configuring a new thepopebot project. It checks prerequisites, creates a GitHub repository, collects API keys, generates secrets, and starts your agent.
Usage
What It Does
The setup wizard is an 8-step interactive process:Step 1: Prerequisites
- Verifies Node.js 18+, npm/pnpm, Git, GitHub CLI (
gh) - Authenticates
ghCLI if needed (runsgh auth login) - Initializes git repo if not already initialized
- Creates GitHub remote if one doesn’t exist
- Checks for ngrok (optional, warns if missing)
Step 2: GitHub PAT
- Prompts for a fine-grained Personal Access Token scoped to your repository
- Validates token and checks required scopes:
- Actions: Read and write
- Administration: Read and write
- Contents: Read and write
- Metadata: Read-only (auto-selected)
- Pull requests: Read and write
- Workflows: Read and write
- Pushes initial commit to GitHub using the PAT
Step 3: API Keys
Chat LLM (runs in the event handler container):- Choose provider: Anthropic, OpenAI, Google, or Custom (OpenAI-compatible)
- Select model from provider’s catalog
- Enter API key
- For custom providers, enter base URL (e.g.,
http://host.docker.internal:11434/v1for local Ollama)
- Option to use different settings for agent jobs
- Choose separate provider and model
- For Anthropic + Claude subscription: option to use OAuth token instead of API key
- Runs
claude setup-tokento generate 1-year OAuth token - Switches job runner from Pi to Claude Code CLI
- API key stays local for chat; GitHub gets OAuth token for jobs
- Runs
- Prompts for Brave Search API key
- If provided, activates
brave-searchskill and pushes symlink to GitHub
Step 4: App URL
- Prompts for public HTTPS URL (e.g.,
https://abc123.ngrok.ioorhttps://mybot.example.com) - Sets
APP_URLandAPP_HOSTNAMEvariables - Generates
GH_WEBHOOK_SECRETfor GitHub webhook validation
Step 5: Sync Config
- Writes all collected values to
.env - Sets GitHub repository secrets:
GH_TOKEN— Personal Access TokenGH_WEBHOOK_SECRET— Webhook validation secretAGENT_<PROVIDER>_API_KEY— API keys for agent jobsCLAUDE_CODE_OAUTH_TOKEN(if using Claude subscription)
- Sets GitHub repository variables:
GH_OWNER,GH_REPO— Repository identifiersAPP_URL— Public URL for webhooksLLM_PROVIDER,LLM_MODEL— Agent job LLM settingsRUNS_ON— GitHub Actions runner type (ubuntu-latestorself-hosted)
Step 6: Build
- Removes
.next/directory - Runs
npm run buildto compile Next.js app - Retries once if build fails
Step 7: Start Server
- Checks if server is already running (
GET http://localhost:80/api/ping) - If not running:
docker compose up -d - If running: prompts to restart
Step 8: Summary
- Displays configuration summary:
- Repository name
- App URL
- Chat LLM provider/model (stored in
.env) - Agent LLM provider/model (stored in GitHub variables)
- Agent runner (Pi or Claude Code CLI)
- GitHub PAT (masked)
- Lists GitHub secrets and variables that were set
Example Output
Re-Running Setup
If.env already exists, the wizard detects previously configured values and offers to keep them:
Chat vs Agent LLM
Your bot has two sides:- Chat — Conversational LLM that runs in the event handler (responds to web chat, Telegram). Config stored in
.env(LLM_PROVIDER,LLM_MODEL) - Agent — Worker LLM that runs in Docker job containers (writes code, modifies files). Config stored in GitHub variables (
LLM_PROVIDER,LLM_MODEL)
Using a Claude Subscription
If you have a Claude Pro (100+/mo) subscription, you can power agent jobs with it instead of API credits:- During setup, choose Anthropic as agent provider
- Answer “yes” to “Do you have a Claude Pro or Max subscription?”
- Install Claude Code CLI if not already installed:
- Generate OAuth token:
- Paste the token (starts with
sk-ant-oat01-) into the wizard
Local Development (ngrok)
For local installs, your server must be reachable from the internet for GitHub webhooks. Use ngrok or port forwarding:https://abc123.ngrok.io) and paste it as APP_URL during setup.
If your ngrok URL changes (free plan resets on restart), update it everywhere:
Prerequisites
Before running setup, install: | Requirement | Install | |-------------|---------|| | Node.js 18+ | nodejs.org | | npm | Included with Node.js | | Git | git-scm.com | | GitHub CLI | cli.github.com | | Docker + Docker Compose | docker.com | | ngrok (local only) | ngrok.com | For ngrok: sign up for a free account, then runngrok config add-authtoken <YOUR_TOKEN> before setup.
Next Steps
After setup completes:- Visit your
APP_URLto chat with your agent - (Optional) Run
npm run setup-telegramto add Telegram support - Edit
config/SOUL.mdto customize your agent’s personality - Edit
config/CRONS.jsonto schedule recurring jobs