Connect OpenCode
Connect OpenCode
Section titled “Connect OpenCode”OpenCode may have several model providers. CMX routes the one you select. Sign in through OpenCode and choose a model there first:
opencode auth logincmx setup --ask-connect-readycmx providers opencode listThe list shows provider IDs, credential readiness, and whether each route is native or connected to CMX. Listing is read only. Connect one of the IDs shown:
cmx providers opencode connect <provider-id>For example, the ID might be opencode, opencode-go, or a provider you configured in OpenCode. Some custom providers need a direct HTTPS endpoint in OpenCode before CMX can connect them. CMX preserves native options and authentication while adding its local route. It supports OpenCode JSON and JSONC configuration and the OPENCODE_CONFIG override.
Restart OpenCode, send a request, then check cmx stats and cmx harness verify.
Return to OpenCode directly
Section titled “Return to OpenCode directly”cmx providers opencode disconnect <provider-id>This restores that provider’s native route and retains unrelated OpenCode edits made while routed. To remove all CMX routing from OpenCode, use cmx harness disable opencode. Restart OpenCode afterward. If restoration reports a conflict, keep CMX installed and follow Troubleshooting; do not delete its backup files manually.
