@cmdop/opencode-setup
v0.1.4
Published
Onboarding CLI for configuring OpenCode to use CmdOp Router.
Downloads
707
Maintainers
Readme
@cmdop/opencode-setup
Configure OpenCode to use CmdOp in one command.
npx @cmdop/opencode-setupWhat it does
- Checks local
opencodeis installed and supported (≥1.4.0) - Lets you pick a curated model (Kimi K2.6, Qwen3 235B, MiniMax M2.7)
- Chooses activation scope (
userorproject) - Accepts your CmdOp API key (hidden prompt,
CMDOP_API_KEY, or--api-key-stdin) - Writes config, verifies it, and tells you to run
opencode
Quick start
Interactive
npx @cmdop/opencode-setupNon-interactive (CI/scripts)
# via env
CMDOP_API_KEY=gp-... npx @cmdop/opencode-setup --scope project --yes
# via stdin
printf '%s' "$CMDOP_API_KEY" | npx @cmdop/opencode-setup --api-key-stdin --scope project --yes --jsonSafe secret inputs
- Hidden interactive prompt
CMDOP_API_KEYenvironment variable--api-key-stdinflag
Plain --api-key is intentionally unsupported.
Where things go
| File | Purpose |
|------|---------|
| ~/.cmdop/opencode/api-key | API key (owner-only permissions, never committed) |
| ~/.config/opencode/opencode.json | User-scoped provider definition |
| ./opencode.json | Project-scoped activation (model + provider) |
| ~/.cmdop/opencode/install-state.json | Install metadata for reruns/updates |
Provider contract
- Provider id:
cmdop - Base URL:
https://router.cmdop.com/v1 - Transport:
chat_completions - Adapter:
@ai-sdk/openai-compatible
Requirements
- Node ≥22.14.0
opencodeCLI on PATH- CmdOp API key (from cmdop.com)
License
Apache-2.0
