opencode-config-cli
v1.2.0
Published
Create and update an OpenCode configuration from the command line.
Downloads
307
Readme
opencode-config-cli
opencode-config-cli creates and updates an opencode.json file in your current directory. Its global command is ocfg.
Requirements
Use Node.js 20 or newer and pnpm.
Install for development
pnpm install
pnpm build
pnpm link --globalYou can also run the source directly while developing.
pnpm dev -- showCommands
Create the default configuration, the .opencode directory, an empty API key file, and the required .gitignore entry.
ocfg initSelect the reasoning effort interactively.
ocfg effortUse the Up and Down arrow keys to move through low, medium, high, and max, then press Enter. You can also set an effort directly.
ocfg effort low
ocfg effort medium
ocfg effort high
ocfg effort maxSelect a supported model.
ocfg modelUse the Up and Down arrow keys to move through the interactive list, then press Enter to select a model. You can also select a model directly, which is useful in scripts.
Supported models:
kimi-k3
deepseek-v4-pro-0813
deepseek-v4.1-flash
glm-5.3-flashx
gpt-5.6-sol
claude-opus-5.5ocfg model kimi-k3
ocfg model deepseek-v4-pro-0813
ocfg model deepseek-v4.1-flash
ocfg model glm-5.3-flashx
ocfg model gpt-5.6-sol
ocfg model claude-opus-5.5Set the model and effort together. Both values are checked before the file is changed.
ocfg use kimi-k3 highShow the active values and configuration path.
ocfg showRestore the default template. The command asks for confirmation unless you pass --force.
ocfg reset
ocfg reset --forceAPI key
Initialization does not ask for an API key. It creates an empty key file when the file is missing and never overwrites an existing key. When you are ready, put the key in this file inside the target project.
.opencode/provider-api-keyThe generated configuration reads the key from that file. ocfg init also ensures the path is present in the target project's .gitignore.
Project checks
pnpm typecheck
pnpm buildPublishing updates
See PUBLISHING.md for the release and global update steps.
