Skip to content
CryoCryo home
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

CommandPurpose
cryo build [file|dir]Build a single .cryo file, or the project whose cryoconfig lives in dir (default .).
cryo runBuild 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 fetchFetch dependencies and write cryoconfig.lock.
cryo updateRe-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 versionPrint 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.

FlagEffect
--debugVerbose compiler logging.
--astDump the AST after parsing.
--emit-llvmEmit LLVM IR (.ll) beside the object output.
--build-dir=PATHOverride [project] output_dir.
--stdlib=PATHStandard-library root for this run (highest priority; see section 24.3).
--target=TRIPLECross-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=NOptimization level 0..3; overrides the profile and [compiler] optimize.
-g, --debug-infoEmit DWARF debug info.
--releaseBuild with the release profile (O2, no debug info).
--release-staticStatic-link libLLVM + the C++ runtime into a self-contained binary for distribution (Linux host only; implies --release).
--devBuild with the debug profile (O0 + DWARF).
--profile=NAMEBuild with a named profile (cache under build/target/NAME/).
--no-incrementalForce a full build: skip the up-to-date short-circuit and the manifest/fingerprint write.
--lockedVerify the cryoconfig.lock vendor pins instead of re-resolving them; error if the lock is missing or out of date.
-o, --output PATHRedirect 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:

  1. --stdlib=PATH - one-off override (this run only)
  2. $CRYO_STDLIB - explicit stdlib pointer (environment)
  3. $CRYO_HOME/stdlib - install-root pointer (set by install.sh)
  4. <bindir>/../stdlib - binary-relative auto-detection
  5. [project] stdlib_root - project-pinned in cryoconfig (relative to the project root when not absolute)
  6. <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.