24Command-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.
24.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; --verbose adds the build details, --triple prints only the default target triple. |
Running cryo <file.cryo> with no command compiles that file directly.
The version string. cryo -v, cryo version and the banner cryo prints with no arguments give the release number, its pre-release label, and after a + the build: the first eight hex digits of the commit the compiler was built from, with -dirty when tracked files differed from that commit (cryo version 1.0.0-alpha+3f9c2a1b). Pre-release labels order the way the release number reads (1.0.0-alpha comes before 1.0.0); the build part identifies a binary and does not order it. The release number and the label are VERSION and PRERELEASE in compiler/src/main.cryo.
The build part is not compiled in. A compiler binary holds a reserved region that cryo stamp <binary> rewrites after linking, from the git checkout in the current directory, so stamping changes no code and nothing the compiler emits; make cryo, make cryo-exe and the release build stamp the compilers they link, with the pinned compiler. An unstamped binary, or one built outside a git checkout, prints +unknown. cryo stamp is not listed in cryo help; cryo help stamp describes it. cryo version --verbose prints, beneath the version line, the binary's path and size, the full commit, its date, the branch, git describe, whether the tree was dirty, the build profile (all from the stamp), and the LLVM version, the default target triple and the stdlib root a build would use. A compiler's build cache key reads the region as zeros, so restamping a compiler does not invalidate what it built.
24.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 23.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.
24.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.
extern "C" function remove(path: u8*) -> i32