Skip to main content

Usage

ocx registry <subcommand> [options]

Description

Manage configured component registries. Registries are sources for components that OCX can install. By default, registry commands operate on local project configuration; use --global for global scope.

Subcommands


Registry Add

Add a new registry to your configuration.

Usage

ocx registry add <url> [options]

Arguments

ArgumentRequiredDescription
urlYesRegistry URL

Flags

FlagShorthandDefaultDescription
--name <name>Registry name (required). Canonical identity used to reference components as <name>/<component>.
--dry-runfalseValidate registry without adding to config
--global-gfalseAdd to global config (~/.config/opencode)
--profile <name>-pUse specific global profile for registry resolution
--cwd <path>Current directoryWorking directory
--jsonfalseOutput as JSON
--quiet-qfalseSuppress output

Examples

# Add a registry with a name
ocx registry add https://registry.example.com --name myregistry

# Add to global config
ocx registry add https://registry.example.com --name myregistry --global

# Validate without adding
ocx registry add https://registry.example.com --name myregistry --dry-run

Identity Model

  • Registry name is canonical identity: The --name you provide becomes the canonical identifier for the registry in your configuration.
  • Components referenced as name/component: Users reference components using the configured registry name (e.g., kdco/researcher).
  • Registry index.namespace not authoritative: The namespace field in the registry’s index.json is informational only.

Constraints

  • URL uniqueness: The same URL cannot be added under multiple names. To change the name, remove it first with ocx registry remove <name>, then add with the new name.
  • No --force for conflicts: Use remove-then-add to update an existing registry name or URL.

Errors

ErrorCauseSolution
No ocx.jsonc foundNot initializedRun ocx init first
Registries are lockedlockRegistries: true in configRemove lock or edit config manually
Registry 'name' already existsName already in useRemove existing registry first
Registry URL already configuredSame URL under different nameRemove existing registry first
--global and --cwd are mutually exclusive.

Registry Remove

Remove a registry from your configuration.

Usage

ocx registry remove <name> [options]

Arguments

ArgumentRequiredDescription
nameYesRegistry name

Flags

FlagShorthandDefaultDescription
--global-gfalseRemove from global config
--profile <name>-pUse specific global profile for registry resolution
--cwd <path>Current directoryWorking directory
--jsonfalseOutput as JSON
--quiet-qfalseSuppress output

Examples

# Remove a registry
ocx registry remove myregistry

# Remove from global config
ocx registry remove myregistry --global

Errors

ErrorCauseSolution
No ocx.jsonc foundNot initializedRun ocx init first
Registries are lockedlockRegistries: true in configRemove lock or edit config manually
Registry 'name' not foundRegistry does not existCheck name with ocx registry list

Registry List

List all configured registries.

Usage

ocx registry list [options]

Flags

FlagShorthandDefaultDescription
--global-gfalseList registries from global config
--profile <name>-pUse specific global profile for registry resolution
--cwd <path>Current directoryWorking directory
--jsonfalseOutput as JSON
--quiet-qfalseSuppress output

Examples

# List registries
ocx registry list

# List global registries
ocx registry list --global

# Get machine-readable output
ocx registry list --json

Output

$ ocx registry list
Configured registries:
  kdco: https://ocx.kdco.dev
  acme: https://registry.acme.com

$ ocx registry list --json
{
  "success": true,
  "data": {
    "registries": [
      { "name": "kdco", "url": "https://ocx.kdco.dev" },
      { "name": "acme", "url": "https://registry.acme.com" }
    ],
    "locked": false
  }
}

See Also