CLI & Scripts
quilt — the main CLI
File: quilt/src/bin.rs
The quilt binary has three subcommands; run is the default, so quilt <file> [args…] is shorthand for quilt run <file> [args…].
quilt expand <file.rs.quilt>
Expands a .quilt file to the corresponding source file (strips .quilt suffix).
quilt expand path/to/foo.rs.quilt # produces foo.rs
quilt expand path/to/foo.py.quilt # produces foo.py
quilt expand path/to/foo.wgsl.rs.quilt # produces foo.wgsl.rs
Options:
-m, --multi <omni|bootstrap>— select whichMultito use. Defaultomni. Usebootstraponly when expandingmk_meta.rs.quiltto regeneratemeta.rs.
The generated file starts with a comment //! DO NOT EDIT. GENERATED BY quilt expand ....
quilt check <file.rs.quilt>…
Validates one or more .quilt files without writing anything: each file is parsed and expanded exactly as expand would, but the result is discarded. Prints <file>: ok per valid file, reports errors for invalid ones (checking every file before failing), and exits non-zero if any file fails — useful for CI pipelines and pre-commit hooks where you don't want generated files checked into git.
quilt check path/to/foo.rs.quilt
quilt check src/*.quilt
Options:
-m, --multi <omni|bootstrap>— same asexpand.
A leading shebang line is stripped before checking (as run does), so executable scripts check clean.
quilt run <file.rs.quilt> [args…]
Expand a .quilt file to a temp file and run it immediately. The file's inner extension determines the runner:
| Extension | Runner |
|---|---|
.rs | rust-script |
.py | python3 (with PYTHONPATH set to include quilt-python) |
The runner is read from Language::hashbang(). If the language does not return a hashbang, quilt errors.
Trailing arguments after the filename are forwarded to the script.
For Rust scripts, quilt injects a //! [dependencies] cargo manifest block in the generated file pointing at the local quilt crate with the correct feature set.
Since run is the default subcommand, the run keyword can be omitted:
quilt examples/hello.rs.quilt World
quilt examples/hello.py.quilt
quilt examples/countdown.rs.quilt 5
Shebang scripts
.quilt files can be used directly as executables with:
#!/usr/bin/env quilt
as their first line (#!/usr/bin/env quilt also works, but the bare form is portable: Linux passes everything after the interpreter as a single argument, so env would look for a program literally named quilt run). quilt strips the shebang before expansion so the language parser doesn't see #!.
bin/ scripts
All scripts in bin/ expect the direnv environment to be active (direnv allow from the repo root). They work from any directory when the env is active.
quilt
quilt expand path/to/file.rs.quilt
quilt path/to/file.rs.quilt [args]
A thin wrapper around cargo run -p quiltlang --. Passes all arguments to the quilt binary.
bootstrap
Runs the full two-stage bootstrap that regenerates quilt/src/langs/rust/meta.rs. Both stages run the generator program mk_meta.rs.quilt via quilt, which writes meta.rs; see Bootstrap.
bootstrap
Equivalent to running bootstrap0 then bootstrap1 in order.
bootstrap0
Stage 0 only: quilt -m bootstrap mk_meta.rs.quilt — expands the generator with BootstrapMetaLanguage (built with --no-default-features -F bootstrap) and runs it.
bootstrap0
bootstrap1
Stage 1 only: quilt -m omni mk_meta.rs.quilt — expands the generator with the freshly generated RustMetaLanguage (self-hosted) and runs it. A clean run leaves meta.rs unchanged.
bootstrap1
ctest / lint
Wrappers around cargo test and cargo clippy --tests that work from any directory (they pass --manifest-path for the repo root).
ctest -p quiltlang node
lint
build-py
Build the quilt_python PyO3 extension module. Required before running .py.quilt files. Rebuild after editing the Python bindings.
build-py
Builds with maturin and installs the abi3 module as quilt-python/quilt/_quilt.abi3.so, which Python can import as import quilt.
ts-gen
Regenerate the tree-sitter parser after editing tree-sitter-quilt/grammar.js.
ts-gen
install_tools
Build and install the editor tooling: cargo install --path quilt-lsp, npm install for the VS Code extension, and symlink tools/quilt into ~/.vscode/extensions/quiltlang. Idempotent; warns if rust-analyzer or rust-script is missing. See Editor Setup.
install_tools
Cargo workspace commands
Run from the repo root (the Cargo workspace root):
cargo build # build all workspace members
cargo test # run all tests
cargo test -p quiltlang node # run tests matching "node" in the quilt crate
cargo clippy # lint
cargo fmt # format
cargo build -p quilt-lsp # build the LSP server
cargo test -p quilt-lsp # run LSP tests
Environment variables
| Variable | Used by | Description |
|---|---|---|
RUST_LOG | quilt, quilt-lsp | tracing log filter (e.g. debug, info) |
QUILT_LSP_RUST_ANALYZER | quilt-lsp | Override rust-analyzer command (whitespace-separated) |
PYTHONPATH | quilt (Python) | Extended to include the quilt-python/ directory |