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
| Command | Purpose | Corresponding Python API |
|---|---|---|
octx create | Create a Package or publish a new Release. | create_octx() |
octx inspect | Read only the manifest summary without full validation. | open_octx() |
octx validate | Perform full validation and print the result. | validate_octx() |
octx unpack | Safely unpack after validation. | unpack_octx() |
Create
octx create ./.octx-workspace \
--from ./knowledge \
--name "Product Guide" \
--output ./product-guide.octxCommon 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
octx inspect ./product-guide.octx
octx validate ./product-guide.octxinspect 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
octx unpack ./product-guide.octx ./product-guide-expandedThe destination directory must not exist or must be empty. The command unpacks only the manifest and declared payloads.
JSON output
Every subcommand supports --json:
octx validate ./product-guide.octx --jsonJSON 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 code | Meaning |
|---|---|
0 | The command succeeded; for validate, the Package is valid. |
1 | validate or pre-publication validation found an invalid Package. |
2 | Command usage, input/output, or another operational error. |