Skip to main content

Usage

ocx init [options]
ocx init --registry <path> [options]

Description

Initialize OCX configuration in your project directory or globally. When used with --registry, scaffolds a new OCX registry project.

Flags

FlagShorthandDefaultDescription
--cwd <path>Current directoryWorking directory
--quiet-qfalseSuppress output
--verbose-vfalseVerbose output
--jsonfalseOutput as JSON
--registry <path>Scaffold a new OCX registry project at path
--namespace <name>Registry namespace (e.g., my-org)
--author <name>Author name for the registry
--canaryfalseUse canary (main branch) instead of latest release
--local <path>Use local template directory instead of fetching
--global-gfalseInitialize in global OpenCode config (~/.config/opencode)

Examples

Initialize Local Project

ocx init
Creates .opencode/ocx.jsonc in the current directory with a default registry configuration.

Initialize Global Configuration

ocx init --global
Creates the global profile directory at ~/.config/opencode/ with base configuration. This is required before creating profiles.

Scaffold a New Registry

ocx init --registry ./my-registry --namespace my-org --author "My Name"
Creates a new registry project with the proper directory structure, manifest, and example components.

See Also