Skip to main content
Documentation

CLI Reference

Commands, backends, and flags supported by the Sidex CLI.

sidex and sidex-cli invoke the same executable. Use --help on a command to inspect its arguments, and --version to identify the build.

Commands that load a bundle locate sidex.toml in the working directory or a parent directory. Paths to generation output are relative to the working directory.

new

sidex new NAME

Creates NAME/sidex.toml with bundle version 0.1.0 and a NAME/schemas directory. Use a new directory name; this command writes the manifest.

check

sidex check [BUNDLE_DIR] [--fix]

Loads schemas and reports definition errors and unused imports. Normal check mode also checks validation expressions and API lifecycle metadata. Error diagnostics cause a nonzero exit.

--fix removes unused imports where possible and formats affected files. It takes the fix path instead of running the validation and lifecycle lints; follow it with sidex check.

fmt

sidex fmt [PATHS...] [--check]

Without paths, formats the current bundle’s schema files. Explicit directories are searched recursively.

Result in Check ModeExit Code
Every file is already formatted0
A file would change1
A file failed to format2

Without --check, the command writes formatted files.

generate

sidex generate BACKEND OUTPUT [--config-override KEY=VALUE]...
BackendOutput
rustmod.rs
tsOne .ts per schema and index.ts
pyOne .py per schema, __init__.py, and py.typed
json-schemaType schema documents and schema-defs.json
irCompact ir.json

Configuration comes from [backend.BACKEND] in the manifest. Repeat --config-override to change individual settings for this invocation.

Override paths are dot-separated; \. escapes a literal dot in a key. The value is parsed as JSON when possible, otherwise stored as a string.

sidex generate ts out --config-override opaque_lowering=json
sidex generate rust out --config-override 'derive=["Debug"]'

Generation creates the output directory. It does not clean stale output files. Rust, TypeScript, and Python generate the selected bundle; JSON Schema walks loaded noninternal bundles.

json generate

sidex json generate BUNDLE::SCHEMA::TYPE [OPTIONS]

Emits random JSON samples following a type’s JSON shape. It does not enforce validation attributes.

FlagDefaultPurpose
--count N1Number of samples
--seed NRandomReproduce a sample sequence
--prettyOffPretty-print each sample
--max-depth N6Bound recursive generation
--max-collection-len N8Bound generated collections and free-form objects
--max-string-len N16Bound strings and free-form keys
--integers-as-stringsOffEmit i64, u64, and idx as decimal strings
--floats-as-stringsOffPermit "NaN", "Infinity", and "-Infinity"

Without --pretty, output is one compact JSON value per line. Limits bound random generation choices rather than validate application data.

The CLI currently has no json validate subcommand. Use a JSON Schema validator or a language runtime to parse application data.

validate-ir

sidex validate-ir FILE

Deserializes Sidex IR and asserts exact equality with compact reserialization. Intended as a strict developer check. It is sensitive to object key order and can reject generated IR containing unordered metadata maps. This is not an application JSON validator.