Skip to content
PortBay

OpenCode runs the card, in an app that is already up

PortBay spawns `opencode run` with the card's brief as its argument, in a project serving at a real URL with a database attached. Open source on both sides of the dispatch.

The short answerVerified against the product, 2026-09-11

How do I run OpenCode against a board of tasks?

PortBay detects the `opencode` binary on your PATH and offers it in the agent picker. Assign it to a card and move that card to To Do: PortBay spawns `opencode run "<the card>"` headless, with the working directory set to your project. OpenCode has a tool-calling loop and edits files, which means the thing that limits it is usually not the model but whether there is anything to call — and that is what PortBay provides. The project is already serving on its own .test hostname behind a certificate macOS trusts, a per-project database is attached and its connection variables injected, and outgoing mail is captured locally, so the agent can request the route it just wrote. Each card takes its own git worktree under .portbay/worktrees/, so several agents work one repo without collision, and a strike system stops a card after three failed runs. Both PortBay and OpenCode are open source, and nothing in the round trip leaves your Mac except the model call OpenCode makes on your own key.

In the app

opencode run, dispatched from a card

acme-shop · Board6 cards3 agents online
Pending2
infra
Rate-limit the API
P1
Dark mode polish
P2
Todo2
auth
Add OAuth login
P0Claude Code0/3oauth-login
Auto-dispatching
implement OAuth on app.test
db
Migrate to Postgres
P1
In Progress1
Fix flaky checkout test
P0
Done2
Set up Mailpit inbox
P2
Seed demo data
P2
1/5 · AssignA card lands in Todo and @claude is mentioned

The card is the argument. The environment is what the tool loop has to work with once the run starts.

Walkthrough

Your first OpenCode card

Five steps from a clean Mac to an OpenCode run you can open in a browser. Every command runs as written.

  1. Install PortBay
  2. Add your project and press play
  3. Check opencode resolves
  4. Write a card and assign OpenCode
  5. Move the card to To Do, then open the result

Install PortBay

Homebrew installs the app and the bundled portbay CLI. Prefer a direct download? Grab the DMG from GitHub Releases and drag PortBay.app into Applications.

brew tap portbay-app/portbay && brew install --cask portbay

Add your project and press play

PortBay detects the stack from the folder, fills in the start command and port, issues the mkcert certificate and attaches a database. The project is now something an agent can actually exercise.

portbay add ~/code/myapp

Check opencode resolves

PortBay looks for opencode on your PATH. Set the path by hand if yours is installed somewhere unusual. Keys stay where OpenCode already reads them — PortBay stores none and proxies nothing.

which opencode

Write a card and assign OpenCode

Brief the task and say how you will know it worked — a URL that should load, a test that should pass. Assign OpenCode on the card, or set it as the board default.

.portbay/tasks/add-search-endpoint.md

Move the card to To Do, then open the result

The run starts in its own worktree and comments what it changed. Open the project URL and use it. Need flags PortBay's default invocation does not pass? Switch the card to the Custom agent and supply the exact command template.

https://myapp.test
Without PortBay

Three OpenCode runs, one working tree

OpenCode is easy to start twice. Starting it twice in the same checkout is the problem.

A card per run means a worktree per run: same repo, separate files, merge when the card reaches Done.

Questions

Asked before downloading

How does PortBay launch OpenCode?

As a headless subprocess: `opencode run "<the card>"`, with the working directory set to the project folder. It uses the opencode install already on your Mac and whatever credentials that install already reads.

What if I need flags PortBay does not pass?

Use the Custom agent. PortBay's built-in invocations are deliberately the common run-this-prompt form rather than an exhaustive flag surface, and the Custom option runs any CLI from a command template you write — same board, same worktree, same card lifecycle.

Can I pick the model for an OpenCode card?

Not from PortBay. OpenCode is one of six agents with no wired model flag, so no model selector is shown and nothing is appended to the command. Configure the model where OpenCode already reads it.

Can OpenCode claim cards itself over MCP?

No. MCP is wired both ways for Claude Code, Codex, Cursor and Gemini only. OpenCode is dispatched to: cards move because you move them, or because auto-dispatch does it when one lands in To Do.

PortBay mascot — a friendly blue tugboat

Give your projects and your agents a real local home.

Download for macOS

Free & open source · macOS 11+ on Apple Silicon · Pro from $10/mo