Skip to content

Repository files navigation

opencode-config

Bootstrap for my opencode setup. Dotfiles-style: this repo is the source of truth, symlinked into ~/.config/opencode.

This config brings together a few pieces:

  • opencode — the terminal agent harness: models, providers, MCP servers, permissions, agents, commands, and plugins live in opencode.json plus the folders in this repo.
  • CLIProxyAPI / cliproxy — local provider bridge at http://127.0.0.1:8317/v1, used here for Claude/Antigravity-style accounts without committing vendor API keys.
  • oh-my-openagent / OMO — orchestration layer for agent routing, model tiers, skills, team workflows, and long-running work loops, configured by oh-my-openagent.json.
  • caveman — compressed communication mode, slash commands, and plugin hooks that keep agent output terse while preserving technical detail.
  • Superpowers — vendored skill system for disciplined workflows: brainstorming, debugging, planning, verification, subagent execution, and review loops.

It is set up for multiple model providers: OpenAI subscription, Anthropic API or official Claude Code where permitted, OpenCode Go, and Ollama / Ollama Cloud. The routing favors cheap open models for routine work, then escalates to stronger subscription or API-backed models when tasks need more reasoning. CLIProxyAPI handles local provider bridging where provider terms permit it; real credentials stay in shell env or provider auth, not in this repo. For Anthropic, use official Claude Code or API/commercial credentials; do not route Free/Pro/Max OAuth credentials through third-party tools unless Anthropic explicitly permits it. CLIProxyAPI also supports multiple accounts for the same provider with round-robin load balancing and failover; this repo does not set up account pools, and any future use should stay within each provider's terms.

Contents

  • opencode.json — main opencode config (providers, models, MCP servers). API keys are placeholders or {env:...} references.
  • oh-my-openagent.json — oh-my-openagent config
  • tui.json — TUI keybinds
  • AGENTS.md — global agent instructions (caveman mode)
  • package.json — plugin/runtime dependencies (installed via bun)
  • agents/ — custom subagents (cavecrew)
  • commands/ — slash commands (caveman suite)
  • plugins/ — opencode plugins (caveman, superpowers)
  • skills/ — skills (superpowers, caveman, and friends)

Install

Prerequisites

This setup expects these CLIs on PATH:

  • opencode >= 1.4.0 — main terminal agent. Install with curl -fsSL https://opencode.ai/install | bash, npm install -g opencode-ai, bun install -g opencode-ai, or brew install anomalyco/tap/opencode.
  • cli-proxy-api — CLIProxyAPI server used by the anthropic and antigravity providers at http://127.0.0.1:8317/v1. Homebrew formula name is cliproxyapi; binary name is cli-proxy-api.
  • bun — installs repo dependencies and runs bunx oh-my-openagent ....
  • node, npm, npx — used by MCP servers such as Playwright and cavemem.
  • git, curl, jq — used by install/verify scripts.

Nice-to-have local tools:

  • Ghostty + tmux, or herdr.dev — fast terminal setup for long opencode sessions.
  • lazygit — quick Git review loop.
  • delta — readable diffs in Git and lazygit.

Detected from this repo:

  • opencode.json loads oh-my-openagent@latest, opencode-antigravity-auth@1.6.0, local superpowers/caveman plugins, Playwright MCP, Sentry MCP, and cavemem MCP.
  • oh-my-openagent.json routes agents across anthropic, openai, google, opencode-go, and ollama model prefixes. Make sure those providers are authenticated or available through CLIProxyAPI / opencode auth.

LLM-assisted install

Paste this into an LLM coding agent with shell access on the target machine:

Install and verify this opencode-config setup end-to-end.

Context:
- Target config repo: <this-repo-url>
- Install path: ~/code/opencode-config
- Runtime config path: ~/.config/opencode
- Required main harness: OpenCode

Your tasks:
1. Check OS and shell (`uname -a`, `$SHELL`) and do not overwrite existing config without backing it up.
2. Install required CLIs: git, curl, jq, node/npm/npx, bun, opencode >= 1.4.0, and CLIProxyAPI (`cli-proxy-api`).
   - macOS: prefer Homebrew (`brew install git jq node bun anomalyco/tap/opencode cliproxyapi`).
   - Linux: use distro packages for basics, `curl -fsSL https://bun.sh/install | bash`, `curl -fsSL https://opencode.ai/install | bash`, and CLIProxyAPI GitHub binary release for this CPU arch.
3. Offer optional quality-of-life tools: Ghostty + tmux or herdr.dev for terminal sessions, plus lazygit + delta for Git review. Configure lazygit to use delta for diffs if both are installed.
4. Ask me which provider subscriptions/accounts I have before running oh-my-openagent installer flags: Claude Pro/Max, ChatGPT/OpenAI, Gemini/Antigravity, Copilot, OpenCode Go, Ollama Cloud, OpenCode Zen.
5. Clone repo to `~/code/opencode-config`, run `./install.sh`, and confirm symlinks in `~/.config/opencode` point back to repo files.
6. Add needed shell env to my chosen rc/env file, but never print or commit secret values. At minimum handle `OLLAMA_API_KEY` if using Ollama Cloud.
7. Start or configure CLIProxyAPI on `127.0.0.1:8317`, authenticate provider accounts with `cli-proxy-api -login` and/or `opencode auth login`, then verify `/health`.
8. Run `bunx oh-my-openagent install --platform=opencode` only if plugin wiring needs repair. Otherwise keep this repo's checked-in `opencode.json` and `oh-my-openagent.json` as source of truth.
9. Verify final state with: `opencode --version`, `cli-proxy-api -h`, `(cd ~/.config/opencode && bun install)`, `bunx oh-my-openagent doctor`, and a fresh `opencode` restart.
10. Report exactly what changed, where backups were written, which auth steps remain manual, and any commands that failed.

Do not claim completion until all verification commands have run and you have launched/restarted opencode once after config/env changes.

This prompt intentionally makes repo files the source of truth. The upstream bunx oh-my-openagent install flow is useful for repair or fresh generated configs, but it may rewrite model/provider choices.

macOS bootstrap script

#!/usr/bin/env bash
set -euo pipefail

# Core package manager. Skip if already installed.
if ! command -v brew >/dev/null 2>&1; then
  /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
fi

brew install git jq node bun anomalyco/tap/opencode cliproxyapi

# Optional local workflow tools.
brew install lazygit git-delta
brew install --cask ghostty

opencode --version
cli-proxy-api -h >/dev/null
bun --version
node --version
npm --version

Linux bootstrap script

#!/usr/bin/env bash
set -euo pipefail

sudo apt-get update
sudo apt-get install -y ca-certificates curl git jq nodejs npm

curl -fsSL https://bun.sh/install | bash
export BUN_INSTALL="$HOME/.bun"
export PATH="$BUN_INSTALL/bin:$PATH"

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

# CLIProxyAPI official binary release.
arch="$(uname -m)"
case "$arch" in
  x86_64|amd64) asset_arch="amd64" ;;
  arm64|aarch64) asset_arch="arm64" ;;
  *) echo "unsupported arch: $arch" >&2; exit 1 ;;
esac
version="$(curl -fsSL https://api.github.com/repos/router-for-me/CLIProxyAPI/releases/latest | jq -r .tag_name)"
curl -fL -o /tmp/cli-proxy-api.tar.gz \
  "https://github.com/router-for-me/CLIProxyAPI/releases/download/${version}/cli-proxy-api_linux_${asset_arch}.tar.gz"
tar -xzf /tmp/cli-proxy-api.tar.gz -C /tmp cli-proxy-api
chmod +x /tmp/cli-proxy-api
sudo mv /tmp/cli-proxy-api /usr/local/bin/cli-proxy-api

# Optional local workflow tools. Package names vary by distro.
# Install lazygit: https://github.com/jesseduffield/lazygit#installation
# Install delta: https://github.com/dandavison/delta#installation

opencode --version
cli-proxy-api -h >/dev/null
bun --version
node --version
npm --version

Shell env

Put machine-local secrets in ~/.zshrc, ~/.bashrc, ~/.profile, ~/.config/environment.d/*.conf, direnv, or your service manager. Do not commit them here.

# Required only if using the Ollama Cloud provider in opencode.json.
export OLLAMA_API_KEY="..."

# Optional if you use Google AI Studio directly instead of Antigravity OAuth.
export GOOGLE_GENERATIVE_AI_API_KEY="..."

# Optional if you bypass CLIProxyAPI and point providers at vendor APIs.
export ANTHROPIC_API_KEY="..."
export OPENAI_API_KEY="..."

Start CLIProxyAPI before launching opencode:

cli-proxy-api -config ~/.cli-proxy-api/config.yaml
curl http://127.0.0.1:8317/health

Then authenticate provider accounts through CLIProxyAPI (cli-proxy-api -login) and/or opencode (opencode auth login) depending on which providers you use.

Git review tools

Use lazygit for branch/diff review and delta for readable diffs:

git config --global core.pager delta
git config --global interactive.diffFilter "delta --color-only"
git config --global delta.navigate true
git config --global merge.conflictStyle zdiff3

Lazygit delta config (~/.config/lazygit/config.yml):

git:
  paging:
    colorArg: always
    pager: delta --dark --paging=never

Repo install

git clone <this-repo> ~/code/opencode-config
cd ~/code/opencode-config
./install.sh

The script backs up any existing config to ~/.config/opencode/backup-<timestamp>/ before symlinking, then runs bun install.

Because files are symlinked, edits made in ~/.config/opencode land in this repo — just commit and push.

oh-my-openagent

This repo already registers oh-my-openagent@latest in opencode.json and carries oh-my-openagent.json. To install or repair the upstream plugin wiring, run:

bunx oh-my-openagent install --platform=opencode
bunx oh-my-openagent doctor

Recommended work flow

Use this loop for non-trivial work. Small fixes can skip the formal plan, but should still preserve the same shape: understand first, decide, edit, verify, then use the result through its surface.

1. Shape the work

  1. Brainstorming — clarify intent, constraints, risks, and success criteria before changing files.
  2. Design — choose user-facing behavior, architecture, and tradeoffs.
  3. Writing plan — turn the design into executable steps in .omo/plans/ when scope spans multiple edits.
  4. Review plan — run Momus plus cavecrew-plancritic to catch missing context, wrong order, and unverifiable steps.

2. Execute safely

  1. Execute with subagents — use start-work / subagents for independent implementation, testing, review, and history lookup.
  2. Remove AI slop — run the remove-ai-slops tool on the branch diff to strip obvious comments, dead code, over-defensive code, needless abstraction, and other behavior-preserving slop.
  3. Refactor pass — run a focused safe refactor pass only where tests or manual QA can prove behavior stayed the same.
  4. Verify — run tests, lint, typecheck, build, LSP diagnostics, and manual QA through the surface users actually touch.

3. Review and iterate

  1. Open PR — keep commits reviewable and summarize verification evidence.
  2. Request reviews — ask human reviewers and GitHub Copilot for review comments.
  3. Triage feedback — separate must-fix bugs from optional style or scope-expanding suggestions.
  4. Iterate fixes — implement accepted feedback, rerun the relevant checks, and update the PR with what changed.
  5. Repeat until clean — keep the loop going until reviews are resolved, checks are green, and the branch works through its user-facing surface.

Verify

command -v opencode
opencode --version

command -v cli-proxy-api
curl http://127.0.0.1:8317/health

command -v bun
command -v npx
(cd ~/.config/opencode && bun install)
bunx oh-my-openagent doctor

Restart opencode after changing opencode.json, oh-my-openagent.json, agents, skills, commands, plugins, or shell env. Running sessions keep already-loaded config.

Not included (intentionally)

Machine-local / secret-prone files, blocked by .gitignore:

  • antigravity-accounts.json (credentials)
  • tasks/, logs/, .omo/ (personal history)
  • bun.lock, node_modules/ (regenerated by bun install)

About

My opencode config with OMO

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages