OpenCode plugin for free-coding-models.
⚠️ BETA — Consumed via local symlink inside thefree-coding-modelsrepo for now.
The OpenCode adapter for the same FCM scanner/ranker used by fcm-pi. All shared logic (scan, rank, cache, daemon, API keys, provider descriptors) lives in fcm-agent-core; this plugin owns only OpenCode config mutation, command hooks, toasts, and shell env.
- Light startup — cache first, daemon second, no direct probe unless requested. OpenCode boot never freezes.
- Adds
/fcm,/fcm-status, and/fcm-routercommands. - Injects FCM providers into OpenCode config using
fcm-*provider IDs. - Never switches on startup — switching requires
/fcm 1,/fcm best, or/fcm router.
| Command | Description |
|---|---|
/fcm |
Scan and list ranked choices without switching |
/fcm 1 / /fcm 2 / … |
Explicitly switch OpenCode config to ranked model #N |
/fcm best |
Explicitly switch to the best ranked model |
/fcm rescan |
Force a fresh scan |
/fcm status (or /fcm-status) |
Diagnostics (cache, daemon, active model) |
/fcm router (or /fcm-router) |
Switch to the local FCM Smart Router daemon |
Symlink the plugin so relative imports still resolve back into this repo:
mkdir -p ~/.config/opencode/plugins
ln -sf /Users/<you>/Documents/GitHub/free-coding-models/packages/fcm-opencode/index.js \
~/.config/opencode/plugins/fcm-opencode.jsThe legacy
opencode-plugin/folder at the repo root is kept as a thin re-export wrapper, so existing symlinks keep working. Thepackages/tree also needs a one-time self-link — seefcm-agent-core/README.md.
- OpenCode plugins cannot currently show a Pi-style interactive picker from the public API, so model selection is rank-number based. It is still explicit: listing does not switch;
/fcm 1or/fcm bestdoes. - API keys are never inlined into config — they are referenced via
{env:FCM_<PROVIDER>_API_KEY}and exported through theshell.envhook. - Cross-tool cache: this plugin reads its own cache first, then falls back to the Pi cache (
~/.pi/agent/fcm-cache.json), so a scan in one tool benefits the other.