OpenCode Integration

Same workflow, different AI. Open source and model-agnostic.

How It Works

You talk to OpenCode. OpenCode runs Pontius commands. That's it.

OpenCode is an open source AI coding agent with 50,000+ GitHub stars. It supports 75+ LLM providers—Claude, GPT, Gemini, local models, whatever you prefer. The workflow with Pontius is identical to every other AI tool.

Installation

Install OpenCode:

curl -fsSL https://opencode.ai/install | bash

Also available via npm, brew, bun, or paru. See opencode.ai for details.

First-Time Setup

Start OpenCode in your terminal:

opencode

Then ask it to set up Pontius:

You: Can you run pontius setup? I want to connect my email.

OpenCode runs the setup command and gets a step-by-step guide. It will:

  • Check your license status (and activate if needed)
  • Walk you through creating an app password for your email provider
  • Guide you through adding your account in the Pontius TUI
  • Set up any aliases you send from
  • Initialize your knowledge base
  • Create an AGENTS.md file for future sessions

The only thing you type directly is your app password (for security—it goes straight to your system keychain). OpenCode handles everything else.

Daily Workflow

Once you're set up, just tell OpenCode to clear your email:

You: Let's clear email.
OpenCode: Running 'pontius blitz'...
I've loaded your preferences and knowledge base. Running 'pontius list'...
Work Account (3 new):
UID FROM SUBJECT
37801 [email protected] Question about pricing
37800 [email protected] Payment received
37799 [email protected] Weekly digest
I see:
- 1 customer question → needs response
- 1 billing receipt (Stripe) → moving to billing folder
- 1 newsletter → archiving
Stabilizers on (learning) or auto (autonomous)?

The Three Commands

Same three commands as every other AI integration:

pontius setup

Connects your email accounts. OpenCode gets a detailed guide and walks you through each step. Run this once per account.

pontius blitz

Starts an email session. This gives OpenCode your preferences, the full command reference, and points it at your knowledge base.

pontius help

The full command reference. OpenCode can run this anytime it needs to check syntax or discover features.

The AGENTS.md File

OpenCode reads from AGENTS.md in your working directory. During setup, create this file to teach OpenCode how to operate Pontius in future sessions:

AGENTS.md
# Email Assistant
You are my AI email assistant. You operate Pontius on my behalf.
## How Pontius Works
Pontius is a CLI email client designed for AI-first workflows. Three commands matter:
- `pontius setup` - Connect email accounts (run if not configured)
- `pontius blitz` - Start an email session (run when I want to clear email)
- `pontius help` - Full command reference (run anytime you need syntax)
## When I Say "Let's Clear Email"
1. Run `pontius blitz` to load my preferences and the session prompt
2. Run `pontius list` to see my inbox
3. Categorize: noise (archive/move), needs response, needs my input
4. Handle noise autonomously based on my patterns
5. Draft responses for my approval (or send if you know the pattern)
6. Ask about anything you're unsure of
## The Knowledge Base
Location: ~/.config/pontius/knowledge/
This is critical. Before responding to any email, check the relevant folders:
- contacts/ - Who this person is, our relationship, their preferences
- templates/ - My proven responses for common situations
- rules/ - Per-account behavior (Work vs Personal)
- policies/ - Hard rules that override everything
- patterns/ - Triggers for automatic actions
## After Each Email Session
Update the knowledge base with what you learned:
- New contacts → add to contacts/contacts.json
- Repeated responses → create a template
- New patterns → add to patterns/patterns.json
- Corrections I made → update the relevant file
The knowledge base should grow every session. Don't skip this step.
## Accounts
- [email protected] (Work) - Professional tone, check policies
- [email protected] (Personal) - Casual tone
## My Preferences
- Sign off: "Best," followed by my name on a new line
- Default tone: Professional but warm
- Always ask before: Anything financial, customer-facing, or to new contacts
- Archive autonomously: Billing receipts, shipping notifications, newsletters

Put this file wherever you typically start OpenCode sessions.

Model Flexibility
OpenCode works with 75+ LLM providers. Use Claude, GPT, Gemini, or local models—Pontius doesn't care which one powers your AI. Same workflow, your choice of brain.

Growing the Knowledge Base

The knowledge base at ~/.config/pontius/knowledge/ is what makes Pontius different from stateless AI tools. Every session should leave it smarter than before.

OpenCode searches it automatically during blitz sessions. After each session, make sure OpenCode updates it with new contacts, templates, and patterns.

Troubleshooting

OpenCode Can't Find Pontius

  • Ask OpenCode to check: "Run which pontius"
  • If not found, install Pontius first
  • Restart OpenCode after installing

Permission Denied

  • Approve the command when OpenCode asks
  • Check OpenCode's permission settings