CompilerToolchain
25Command-Line Interface
cryo is a single binary: the compiler, package manager, test runner, and dependency resolver. Run cryo (or cryo --help) for a command overview, cryo help <command> for one command, and cryo help <topic> for the topics below.
25.1 Commands
| Command | Purpose |
|---|---|
cryo build [file|dir] | Build a single .cryo file, or the project whose cryoconfig lives in dir (default .). |
cryo run | Build the project and run the resulting executable. |
cryo test [pattern] | Build and run the project's ![test] functions. |
cryo check <file> | Front-end + semantic analysis only; no codegen. |
cryo init [dir] | Scaffold a new project (cryoconfig + main.cryo). |
cryo raw <file> | Compile without the stdlib or prelude. |
cryo demangle <sym> | Decode a mangled symbol to its source form. |
cryo fetch | Fetch dependencies and write cryoconfig.lock. |
cryo update | Re-resolve every dependency, ignoring the lockfile. |
cryo vendor <sub> | Manage the per-machine registry of vendored C libraries: <path> | list | remove <name> | rebuild [name]. |
cryo version | Print the compiler version. |
Running cryo <file.cryo> with no command compiles that file directly.
25.2 Build flags
Accepted by build / run / test / check as noted; run cryo help flags or cryo help <flag> for detail.
| Flag | Effect |
|---|---|
--debug | Verbose compiler logging. |
--ast | Dump the AST after parsing. |
--emit-llvm | Emit LLVM IR (.ll) beside the object output. |
--build-dir=PATH | Override [project] output_dir. |
--stdlib=PATH | Standard-library root for this run (highest priority; see section 24.3). |
--target=TRIPLE | Cross-compile for an LLVM target triple. x86_64-pc-windows-gnu links to a .exe via mingw-w64; other triples emit object files only. |
--opt-level=N | Optimization level 0..3; overrides the profile and [compiler] optimize. |
-g, --debug-info | Emit DWARF debug info. |
--release | Build with the release profile (O2, no debug info). |
--release-static | Static-link libLLVM + the C++ runtime into a self-contained binary for distribution (Linux host only; implies --release). |
--dev | Build with the debug profile (O0 + DWARF). |
--profile=NAME | Build with a named profile (cache under build/target/NAME/). |
--no-incremental | Force a full build: skip the up-to-date short-circuit and the manifest/fingerprint write. |
--locked | Verify the cryoconfig.lock vendor pins instead of re-resolving them; error if the lock is missing or out of date. |
-o, --output PATH | Redirect output for single-file builds; the output kind is inferred from the extension (.o, .s, .ll, or an executable). |
Test-only flags: --ignored, --list, --exact, -q / --quiet.
25.3 Standard-library lookup
The compiler resolves the stdlib root from the first source that matches:
--stdlib=PATH- one-off override (this run only)$CRYO_STDLIB- explicit stdlib pointer (environment)$CRYO_HOME/stdlib- install-root pointer (set byinstall.sh)<bindir>/../stdlib- binary-relative auto-detection[project] stdlib_root- project-pinned in cryoconfig (relative to the project root when not absolute)<project_root>/../stdlib- in-tree fallback
Most installs need none of these: the binary-relative default (4) finds the stdlib shipped alongside cryo. Projects living outside the Cryo repo pin a specific stdlib with [project] stdlib_root.