opencode-pi
v1.1.2
Published
Bridge OpenCode CLI free models into Pi without OpenCode login
Maintainers
Readme
opencode-pi
opencode-pi registers an opencode-cli provider in Pi and delegates model calls to the local opencode CLI.



It is intended for the free OpenCode models that work without opencode auth login, such as:
opencode/deepseek-v4-flash-freeopencode/mimo-v2.5-freeopencode/nemotron-3-super-freeopencode/big-pickle
Requirements
- Pi Coding Agent
- OpenCode installed and available on the same machine:
opencode --version
opencode models opencodeNo OpenCode login is required for the bundled free OpenCode models.
Install
Published on npm: opencode-pi. Use Pi's package manager (pi install), not npm install alone.
pi install npm:opencode-pi
pi install npm:[email protected] # pin version
pi install -l npm:opencode-pi # project-local (.pi/settings.json)
pi -e npm:opencode-pi # one session, no installThen run /reload in Pi (or restart).
pi list
pi update npm:opencode-pi
pi remove npm:opencode-piFrom pi-extensions (git):
cp -r extensions/opencode-pi ~/.pi/agent/extensions/
# or from repo root: npm run install-extensionsUsage
Pick the provider from /model, or start Pi directly:
pi --provider opencode-cli --model opencode/deepseek-v4-flash-freePrint-mode smoke test:
pi -p --provider opencode-cli --model opencode/deepseek-v4-flash-free "Reply with exactly OK"Commands:
/opencode-pi status
/opencode-pi models
/opencode-pi test
/opencode-pi update
/opencode-pi helpRefreshing the model list
OpenCode changes its free model roster frequently. Refresh the registered models at runtime:
/opencode-pi updateThis queries opencode models opencode, updates the provider's model list, and shows how many new models were added. The status command also displays the timestamp of the last discovery.
Configuration
| Environment variable | Description |
| -------------------- | --------------------------------------------------------------------------------------------------- |
| OPENCODE_PI_BIN | Override the OpenCode executable path. Defaults to opencode. |
| OPENCODE_PI_MODELS | Comma- or space-separated model list to register. Values without / are prefixed with opencode/. |
Example:
OPENCODE_PI_MODELS="opencode/deepseek-v4-flash-free,opencode/mimo-v2.5-free" piHow it works
For each Pi model call, the extension:
- Creates a temporary OpenCode project with a locked-down
pi-modelagent. - Denies OpenCode's own tools (
bash,edit,read, web tools, subagents, etc.). - Sends Pi's current prompt/context to
opencode run --format jsonover stdin. - Streams the final OpenCode text back into Pi.
- Converts
<pi_tool_call>{...}</pi_tool_call>markers into real Pi tool calls, so Pi executes tools rather than OpenCode.
This keeps file access and edits under Pi's normal tool pipeline.
Notes and limitations
- This is a CLI bridge, not a native provider API. It is slower than direct HTTP providers because it starts
opencode runfor each model turn. - Tool calling is prompt-bridged. It works for common cases, but native tool-call providers will be more reliable.
- Image input is not registered; these models are exposed as text-only in Pi.
- If OpenCode ever attempts to use its own tools, the extension fails the turn instead of hiding it.
