GitHub
Use Pochi's AI assistant directly in your GitHub repository by commenting on pull requests to perform code reviews, explain changes, and suggest improvements.
How it works
This integration runs inside a GitHub Actions runner. It temporarily installs the pochi CLI and executes tasks in the context of your repository. Progress is continuously updated under the triggering comment, and a final result (✅/❌) is posted when finished.
Getting Your API Keys
- Log in to your Pochi account and go to API Keys from your user menu
- Create a new API key with a descriptive name
- Copy the generated key (it's only shown once)
- Add it to your GitHub repository as a secret named
POCHI_API_KEY
. See GitHub's official guide for detailed steps:- Go to Settings → Secrets and variables → Actions
- Click "New repository secret"
- Name:
POCHI_API_KEY
, Value: your API key
Setup
Create a workflow file .github/workflows/pochi.yml
in your repository:
name: pochi
on:
issue_comment:
types: [created]
jobs:
pochi:
if: startsWith(github.event.comment.body, '/pochi')
runs-on: ubuntu-latest
permissions:
contents: write
issues: write
pull-requests: write
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
fetch-depth: 1
- name: Run pochi
uses: tabbyml/pochi/packages/github-action@main
env:
# Required: Pochi session token (get it from app.getpochi.com and add as a repository secret)
POCHI_API_KEY: ${{ secrets.POCHI_API_KEY }}
# Optional: custom model (defaults to CLI's default model if not set)
# See the Models page for model options and configuration
# POCHI_MODEL: google/gemini-2.5-pro
Notes:
- Triggered by
issue_comment
(created) and runs only if the comment body starts with/pochi
- Requires write permissions to read changes, post comments, and add reactions to PRs
- Provide
POCHI_API_KEY
via env; optionally setPOCHI_MODEL
to customize the model - By default, the action uses GitHub's built-in
GITHUB_TOKEN
(github-actions bot). You can customize this by setting a customGITHUB_TOKEN
environment variable with your own Personal Access Token (PAT)
Usage
Comment on a PR with /pochi
followed by your request, e.g. /pochi review this code
, /pochi explain the changes in this PR
, /pochi suggest improvements
.
Once triggered:
- Pochi reacts to your comment with 👀 to indicate it's running
- A progress comment is updated every 15 seconds
- When finished, it posts the final result and reacts with 🚀 (success) or −1 (failure)
Permission requirement: Only users with write/admin permission can trigger execution. Otherwise, an error will be posted as a comment.
Advanced configuration
Use a custom GitHub token (optional)
By default, the action uses the GitHub-provided GITHUB_TOKEN
. For cross-repo or higher-privileged operations, you can override it with a PAT:
- name: Run pochi
uses: tabbyml/pochi/packages/github-action@main
env:
GITHUB_TOKEN: ${{ secrets.CUSTOM_GITHUB_TOKEN }} # Your PAT
POCHI_API_KEY: ${{ secrets.POCHI_API_KEY }}
Permissions
Ensure the workflow includes these permissions:
permissions:
contents: write # Read repo contents and commit changes if needed
issues: write # Comment on issues/PRs
pull-requests: write # Access PR information and status