Claude/Gemini-style TUI via upstream opencode, plus a lightweight headless wrapper ocx for fast model/mode switching using OpenAI GPT‑5 models (gpt-5, gpt-5-mini, gpt-5-nano).
Prereqs:
-
Install upstream opencode (see their README). Common installs:
- macOS:
brew install sst/tap/opencode - Any:
npm i -g opencode-ai
- macOS:
-
Go 1.22+ installed for building
ocx
Build ocx locally:
cd cmd/ocx
go build -o ocx .
sudo mv ocx /usr/local/bin/Set your API key:
export OPENAI_API_KEY="sk-..."
# (optional) add to ~/.zshrc or ~/.bashrcUse it:
ocx --model gpt-5-mini --mode code "Write a Python function that parses CSV to JSON"
ocx --model gpt-5 --mode plan "Design a FastAPI service with JWT auth"
ocx --model gpt-5-nano --mode debug --file app.py "Fix NoneType crash on startup"If you prefer the full TUI:
opencode
# TAB toggles Plan/Build, /models switches models, @ adds files- Push this repo to
https://github.com/YOURUSER/opencode-gpt5-fork. - Tag a release:
git tag v0.1.0
git push origin v0.1.0- GitHub Actions will publish binaries (macOS, Linux, Windows) to Releases.
Install via curl on macOS/Linux:
curl -fsSL https://raw.githubusercontent.com/YOURUSER/opencode-gpt5-fork/main/scripts/install.sh | bashWindows PowerShell:
iwr -useb https://raw.githubusercontent.com/YOURUSER/opencode-gpt5-fork/main/scripts/install.ps1 | iexReplace
YOURUSERabove with your GitHub username (or org).
presets/opencode.json pre-maps gpt-5, gpt-5-mini, gpt-5-nano for OpenAI.
ocx writes .opencode/opencode.json into your project with the selected default model.
ocxlaunches the upstreamopencodeTUI with your model and style preselected.- For purely non-interactive runs, we’ll tighten the integration later.
- This repo intentionally avoids heavy changes to upstream opencode.