Skip to main content
Use ocx --help or ocx <command> --help for the installed version’s options. This reference describes OCX 3 for OpenCode V2. ocx oc --help forwards to OpenCode’s help.

Commands

Choose a destination

File operations always require exactly one destination:
The first targets the named profile. The second targets .opencode/ in the current directory, or the directory supplied by --cwd. Initialize a project with ocx init --project first. OCX_PROFILE and profile use select launches; they never silently select a file-mutation destination. --global selects source metadata for browsing and profile creation, not a directory for installing components.

Common options

Options are command-specific; the detailed pages list the supported set. A dry-run can still fetch registry files and detect errors. It is a preview, not a reservation: rerunning an operation checks the then-current files and upstream content.

JSON and automation

Successful JSON shapes depend on the command. For example, search returns data.components, profile listing returns profiles and defaultProfile, and verification returns verified and errors. Do not assume every success has the same envelope. Handled failures with --json include success: false, an error with a code and message, and an exitCode. Argument-parser failures can still be ordinary CLI errors. Check the process exit code as well as the JSON content. For dry-run reports, inspect validation.passed and any warnings; a preview may successfully describe an operation that would be refused. The importer likewise reports unresolved decisions without applying them.

Exit codes

oc returns the native child’s exit status, including signal exits. Self-uninstall also distinguishes safety refusals and package-manager follow-up; see its reference.