Keyboard shortcuts

Press or to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

CLI Reference

Use sora --help for the installed binary’s exact help text, and sora <command> --help for command-specific options. This page summarizes the common workflow commands, aliases, and short flags.

Global Options

Global options can be placed before or after the subcommand.

OptionDescription
-j, --jobs <N>Maximum worker threads. Must be greater than zero.
--serialDisable parallel execution.
--parser-script <PATH>Load a custom Lua cell parser script. Can be repeated. Project-level parser scripts can also be configured in [parsers].scripts in project.toml.
--type-mapping-script <PATH>Load a custom Lua type mapping script. Can be repeated. Project-level scripts can also be configured in [type_mappings].scripts in project.toml.
-h, --helpPrint help.
-V, --versionPrint the CLI version.

Command Aliases

CommandAliases
buildb
checkc
initi
geng
exporte
diffd
excel-templatetemplate, et
excel-syncsync, es
schema-locklock, sl
studiost

Common Short Flags

ShortLongUsed by
-p--projectProject-reading commands.
-o--outinit, gen, export, diff, excel-template, schema-lock.
-s--scopebuild, gen, export, diff, excel-template, excel-sync, schema-lock.
-t--targetbuild, gen.
-f--formatexport.
-d--data-rootbuild, export, excel-sync.
-l--lock, --left-rootcheck, diff.
-r--right-rootdiff.
-c--cleanbuild.
-w--writeexcel-sync.

Commands

init

Create a new project scaffold.

sora init --out my-config --schema-format toml
sora i -o my-config --schema-format yaml
OptionDescription
-o, --out <DIR>Output directory for the scaffold.
`–schema-format <tomlyaml
--forceAllow writing into an existing scaffold path.

check

Validate a project schema, optionally against a schema lock.

sora check --project project.toml
sora c -p project.toml -l generated/schema.lock
OptionDescription
-p, --project <PATH>Project manifest path.
-l, --lock <PATH>Existing schema lock to verify against.

build

Run outputs declared in [build] in project.toml, such as schema locks, Excel templates, codegen, and exports.

sora build --project project.toml
sora b -p project.toml -t rust -c
OptionDescription
-p, --project <PATH>Project manifest path.
`–default-source-format <csvjson
-d, --data-root <DIR>Data input root. Overrides [build].data_root.
-s, --scope <NAME>Build only schema items included in a scope.
-t, --target <NAME>Codegen target to run. Can be repeated.
-c, --cleanDelete selected generated outputs before rebuilding.

gen

Generate code for one target directly, without using [build.codegen].

sora gen --target rust --project project.toml --out generated/rust
sora g -t typescript -p project.toml -o generated/typescript
OptionDescription
-t, --target <NAME>Codegen target, such as rust, typescript, or python.
-p, --project <PATH>Project manifest path.
-o, --out <DIR>Output directory.
`–format-code <neverauto
-s, --scope <NAME>Generate only schema items included in a scope.

export

Load table data and export runtime data.

sora export --project project.toml --data-root data --format json --out generated/config.json
sora e -p project.toml -d data -f binary -o generated/config.sora
OptionDescription
-f, --format <NAME>Export format, such as binary, json, debug-json, cbor, sora-protobuf, or typed-protobuf.
`–default-source-format <csvjson
-p, --project <PATH>Project manifest path.
-d, --data-root <DIR>Data input root.
-o, --out <PATH>Output file or directory, depending on export format.
-s, --scope <NAME>Export only schema items included in a scope.
`–compression <nonezstd>`
--compression-level <N>Compression level for compressed exports.

diff

Compare two data roots using the same project schema.

sora diff --project project.toml --left-root old-data --right-root data --out generated/diff.json
sora d -p project.toml -l old-data -r data -o generated/diff.json
OptionDescription
`–default-source-format <csvjson
-p, --project <PATH>Project manifest path.
-l, --left-root <DIR>Baseline data root.
-r, --right-root <DIR>Changed data root.
-o, --out <PATH>Diff output path.
-s, --scope <NAME>Diff only schema items included in a scope.

excel-template

Generate empty Excel workbooks from the schema. Use this for new workbooks, not for existing data files.

sora excel-template --project project.toml --out generated/excel
sora et -p project.toml -o generated/excel
OptionDescription
-p, --project <PATH>Project manifest path.
-o, --out <DIR>Output directory for generated workbooks.
-s, --scope <NAME>Generate templates only for schema items included in a scope.

excel-sync

Preview or apply schema header updates to existing Excel data workbooks while preserving data rows. Removed schema fields stay as ignored legacy columns.

sora excel-sync --project project.toml --data-root data
sora es -p project.toml -d data -w
OptionDescription
-p, --project <PATH>Project manifest path.
-d, --data-root <DIR>Data workbook root.
-s, --scope <NAME>Sync only schema items included in a scope.
-w, --writeWrite workbook changes. Without this flag, the command previews changes only.

schema-lock

Write a schema lock for the current normalized schema.

sora schema-lock --project project.toml --out generated/schema.lock
sora sl -p project.toml -o generated/schema.lock
OptionDescription
-p, --project <PATH>Project manifest path.
-o, --out <PATH>Schema lock output path.
-s, --scope <NAME>Lock only schema items included in a scope.

studio

Start the embedded Sora Studio schema editor.

sora studio --project project.toml
sora st -p project.toml --port 5180
OptionDescription
-p, --project <PATH>Project manifest path.
--host <IP>Bind address. Defaults to 127.0.0.1.
--port <PORT>Port. Defaults to 5174.