Skip to main content

Usage

Description

Validate a registry source without building it. This command performs comprehensive validation checks on the registry manifest (registry.jsonc or registry.json) including schema validation, file existence checks, circular dependency detection, and duplicate target detection. Intended for registry authors who want to verify their registry before building or deploying. Unlike ocx build --dry-run, this command focuses exclusively on validation and provides detailed error reporting without attempting to generate output files.

Arguments

Flags

Examples

Validate Registry in Current Directory

Validate from a Specific Directory

CI/CD Integration

ocx validate uses distinct exit codes so CI can tell validation failures apart from runtime/tool failures:
  • 0 — registry is valid
  • 78 — configuration or validation failed (CONFIG_ERROR or VALIDATION_FAILED)
  • other non-zero codes — runtime/tool failures (for example missing manifest/source directory, I/O, or internal errors)
Referenced files missing under files/ are validation failures and return 78. Example shell gate:

Skip Duplicate Target Validation

JSON Output for Scripting

JSON output is provided for both success and failure cases, making it suitable for automated tooling.

Quiet Mode

Suppresses all output (including errors). Check the exit code to determine outcome (0 for valid, 78 for configuration/validation failures—including missing referenced files under files/—and other non-zero for runtime/tool failures). Note: When using --json and --quiet together, JSON output takes precedence.

Output

Success

Validation Failure

Human-readable output:
JSON output:

Runtime / Tool Failure (JSON)

Runtime failures (for example missing manifest file, I/O failures, or internal errors) use the standard failure envelope with non-validation error codes:

Validation Checks

The validate command performs the following checks:
  1. Schema Validation — Validates the manifest structure and required fields
  2. File Existence — Ensures all referenced files exist in the source directory
  3. Circular Dependencies — Detects circular dependencies between components
  4. Duplicate Targets — Identifies components that write to the same target paths

Source Structure

The validate command expects a manifest file in the source directory (registry.jsonc preferred, registry.json also supported):

Errors

See Also