Skip to main content

Usage

ocx add <components...> [options]

Description

Add components or npm plugins to your project. Components are copied into .opencode/ (not node_modules) — you own the code and can customize freely.

Arguments

ArgumentRequiredDescription
components...YesComponents to install (name/component or npm:package[@version])

Flags

FlagShorthandDefaultDescription
--dry-runfalseShow what would be installed without making changes
--skip-compat-checkfalseSkip version compatibility checks
--trustfalseSkip npm plugin validation
--profile <name>-pUse specific profile
--from <url>Use ephemeral registry (does not persist)
--cwd <path>Current directoryWorking directory
--quiet-qfalseSuppress output
--verbose-vfalseVerbose output
--jsonfalseOutput as JSON
--global-gfalseUse global config

Examples

Add a Component from a Configured Registry

ocx add shadcn/button

Add Multiple Components

ocx add shadcn/button shadcn/card shadcn/dialog

Add an npm Plugin

ocx add npm:@opencode/plugin-github

Add with a Specific Version

ocx add npm:@opencode/plugin-github@1.2.3

Preview What Would Be Installed

ocx add shadcn/button --dry-run

Use an Ephemeral Registry

ocx add kdco/workspace --from https://my-registry.com
The --from flag provides a one-time registry reference without saving it to your configuration. The registry name is inferred from the component reference (e.g., kdco from kdco/workspace).

Integrity Verification

When a component is already present in your V1 receipt file (.ocx/receipt.jsonc), OCX computes the SHA-256 hash of the incoming content and compares it against the recorded hash. If the hashes do not match, the installation fails immediately with an INTEGRITY_ERROR. To intentionally update a component whose source has changed, use ocx update instead.

See Also