Skip to main content

Overview

This document specifies the HTTP API that OCX-compatible registries must implement. Registries serve component metadata and files as static JSON endpoints.
V2 Changes: Registry targets are now root-relative (no .opencode/ prefix required). The OCX CLI handles path resolution based on component type.

Discovery (Optional)

Optional discovery metadata for clients that support a /.well-known/ocx.json lookup. Response:
If not provided, clients must be configured with the full registry URL.
ocx registry add currently validates registries by requesting <registry-url>/index.json directly. It does not resolve /.well-known/ocx.json during add flows.

Required Endpoints

Registry Index

Returns registry metadata and a list of available components. Response:
Component summaries inside components[] use this shape: namespace and per-component version are not part of the runtime-required summary contract.
For v2 registries, publish $schema: "https://ocx.kdco.dev/schemas/v2/registry.json". If $schema is missing (or uses the unversioned legacy URL), OCX CLI treats the payload as legacy v1 compatibility mode.
Component resolution uses the configured alias from ocx registry add --name <alias> (for <alias>/<component> refs), not any registry-declared namespace field.

Component Packument

Returns full component metadata in npm-style packument format. Response:

File Content

Returns raw file content for installation.

Component Types

Targets in registry files are root-relative. The OCX CLI resolves them to the appropriate .opencode/ subdirectory based on component type.

Blocked Paths

Registry components cannot target these paths:
  • .ocx/ — OCX state and receipt
  • ocx.jsonc — OCX configuration
  • package.json — Package manifest
  • .git/ — Git internals
  • .env — Environment secrets
  • node_modules/ — Dependencies
Additional Security Constraints:
  • Absolute paths (starting with / or drive letters like C:) are rejected
  • Path traversal sequences (../, ..\\) are rejected
  • Null bytes and control characters are rejected

Minimal Compliant Registry

A registry with a single skill needs three files:
/index.json:
/components/my-skill.json:

Hosting Options

See Also