cratestack-cli
Command-line tool for .cstack schema validation and client/Studio code generation.
Installation
Prebuilt binaries (macOS x64/arm64, Linux x64/arm64, Windows x64) are attached to every GitHub Release — no Rust toolchain required.
Via cargo-binstall:
Via npm (downloads the matching platform binary from GitHub Releases on install):
# or run without installing:
From source, with a Rust toolchain:
Or from the workspace:
Commands
check — validate a schema
Flags:
--schema <PATH>— path to the.cstackfile (required)--format <human|json>— output format (defaulthuman)
On success the human formatter writes schema OK: <path>; the JSON formatter prints a { ok: true, ... } document. On error the human formatter renders a diagnostic and exits non-zero; the JSON formatter prints { ok: false, diagnostics: [...] } and exits 1.
generate-dart — Dart package
Flags:
--schema <PATH>(required)--out <PATH>(required)--library-name <NAME>(defaultcratestack_client)--base-path <PATH>(default/api)--template-dir <PATH>(optional)--check(drift-detection mode — see below)
generate-typescript (alias generate-ts)
Flags:
--schema <PATH>(required)--out <PATH>(required)--package-name <NAME>(defaultcratestack-client)--base-path <PATH>(default/api)--template-dir <PATH>(optional)--check(drift-detection mode — see below)--full-selection(emit fully-required model interfaces, driven by the schema's own nullability, instead of the projection-driven optional-everywhere default — for consumers that never do partialfields/includeselection)
--check — drift detection (CI guard)
Both generate-dart and generate-typescript accept --check: instead of writing
to --out, the command generates in memory and diffs the result file-by-file
against what's already on disk. It exits 0 if they match, and non-zero with a
list of drifted files (modified, missing, or unexpected) otherwise. No files
under --out are written or modified in --check mode.
Use this in CI to catch a schema change that nobody regenerated the client for, or a hand-edit to committed generated code.
studio — admin and testing surface
Replaces the old generate-studio codegen scaffold. The studio reads a
workspace file (studio.toml) listing one or more .cstack schemas plus
their DB and/or API targets, then serves a single binary.
Subcommand flags:
init:--out <DIR>(default.),--forceto overwrite an existingstudio.tomlrun:--config <PATH>(defaultstudio.toml),--bind <ADDR>(default127.0.0.1:7878)eject:--config <PATH>(defaultstudio.toml),--out <DIR>(required)
print-ir — dump parsed schema IR
Build Integration
See Also
- Quickstart
cratestack-client-dart— Dart package structurecratestack-client-typescript— TypeScript package structurecratestack-studio-generator— Studio scaffold internals
License
MIT