API/Command-Line Interface

CLI and Errors

Command-Line Interface

Use the octx create, inspect, validate, and unpack commands.

Installing octx provides a command with the same name. The CLI uses the same creation, reading, validation, and security boundaries as the Python API.

Commands

CommandPurposeCorresponding Python API
octx createCreate a Package or publish a new Release.create_octx()
octx inspectRead only the manifest summary without full validation.open_octx()
octx validatePerform full validation and print the result.validate_octx()
octx unpackSafely unpack after validation.unpack_octx()

Create

bash
octx create ./.octx-workspace \
  --from ./knowledge \
  --name "Product Guide" \
  --output ./product-guide.octx

Common options:

  • --version 1.1.0: publish a subsequent Release.
  • --derive: create a derived Asset from an unpacked external Package.
  • --capability NAME=VERSION: declare a Capability; this option can be repeated.
  • --from SOURCE: copy Markdown from the source directory into the workspace; the source directory is not modified.

Inspect and validate

bash
octx inspect ./product-guide.octx
octx validate ./product-guide.octx

inspect displays only the name, Asset ID, Release, file count, and document count, and explicitly reports that validation was not performed. It is not a substitute for validate.

Safe unpacking

bash
octx unpack ./product-guide.octx ./product-guide-expanded

The destination directory must not exist or must be empty. The command unpacks only the manifest and declared payloads.

JSON output

Every subcommand supports --json:

bash
octx validate ./product-guide.octx --json

JSON mode is suitable for CI, Agents, and server-side callers. Usage errors, OCTX exceptions, and validation reports all use stable structures, so callers do not need to parse natural-language logs.

Exit codes

Exit codeMeaning
0The command succeeded; for validate, the Package is valid.
1validate or pre-publication validation found an invalid Package.
2Command usage, input/output, or another operational error.