Usage
Description
Launch OpenCode with resolved configuration and profile support. OCX merges profile settings, discovers instruction files, applies pattern filtering, and spawns OpenCode with the final configuration.Flags
| Flag | Shorthand | Default | Description |
|---|---|---|---|
--profile <name> | -p | Use specific global profile | |
--no-rename | false | Skip automatic window/terminal renaming |
Only
-p/--profile and --no-rename are OCX flags. All other arguments and flags pass through to OpenCode. Use -- to pass flags that conflict with OCX (e.g., ocx oc -- --help forwards help to OpenCode).Examples
Launch with Default Profile
Launch with Specific Profile
Skip Window Renaming
Use Environment Variable
Use the Short Alias
Pass Flags to OpenCode
Profile Resolution Priority
Profiles are resolved in this order (first match wins):profilefield in.opencode/ocx.jsonc— Project-specific profile--profile/-pflag — Explicit CLI specificationOCX_PROFILEenvironment variable — Session-level profiledefaultprofile — If it exists- No profile — Base configurations only
How It Works
- Profile Resolution: Resolves profile using the priority order above.
- Instruction Discovery: Discovers instruction files in priority order.
- Pattern Filtering: Applies exclude/include patterns from profile.
- Launch OpenCode: Spawns with profile configuration and discovered instructions.
~/.config/opencode/ocx.jsonc) are only used for downloading profiles, never for components. When using a profile, registries come from the profile config. This isolation prevents global registries from injecting components into all projects.
Custom OpenCode Binary
To use a custom OpenCode binary, set thebin option in your profile’s ocx.jsonc:
binin profile’socx.jsoncOPENCODE_BINenvironment variableopencode(system PATH)
See Also
- Profiles Overview — Core profile concepts.
- Profile Configuration — Instruction discovery and pattern filtering details.
- ocx profile — Manage profiles.
- CLI Reference — All commands.