Skip to main content
The two most common commands you’ll reach for are sifr run and sifr build. Both compile your Sifr source to native code through the same pipeline — the difference is what happens after compilation. sifr run executes the result immediately; sifr build writes a binary to disk that you can distribute or invoke later.

sifr run — compile and execute

sifr run compiles your program and runs the resulting binary in a single step. When the compiler has a cached binary from a previous run on the same source, it skips the build phase and jumps straight to execution.
Pass arguments to your program after --:

Flags

Examples

sifr run prints build progress to stderr only when the binary cache misses. A cache hit produces no build output — your program’s stdout follows immediately. --quiet suppresses progress even on a cache miss.

sifr build — compile to a native binary

sifr build compiles your program and writes a native binary to the output directory. Use this when you want a standalone artifact you can run later, ship in a container, or benchmark.
Specify an output directory with -o:

Flags

Build output

A successful build in the default human diagnostic format writes a phase-aware summary to stderr:
With --quiet, the summary is shortened to:
Build progress and success banners appear only in the default human diagnostic format. When you use --diagnostic-format json or --diagnostic-format compact, no human-readable progress is emitted on stdout or stderr. Scripts should consume a machine-oriented format instead of parsing words like Finished or Binary.

Examples

The check, build, and run lock flags require package context and an authoritative Cargo.lock; Sifr rejects every constrained manifestless command instead of silently falling back to normal resolution. For Rust interop packages, the selected mode also governs signature probes and the generated Cargo build.

Single-file mode vs project mode

Both sifr run and sifr build select the compilation mode from the nearest ancestor sifr.toml. The mode determines how local imports are resolved. Single-file mode is used for every explicit .sifr file outside a workspace, regardless of its filename, imports, or neighboring files. Project mode is used for every valid entrypoint inside the nearest valid ancestor sifr.toml workspace, regardless of its filename or imports. A malformed discovered manifest is a hard diagnostic.
A manifest-less file compiles in isolation. Local sibling imports require a workspace manifest.
The compilation-mode resolver for sifr run, build, check, emit, and trace uses the same workspace boundary for an explicit input path.
Known issue #3128 affects the package-session preflight. If the current directory contains a source-only sifr.toml without package metadata, this preflight can fail before mode resolution. Until the issue is fixed, invoke explicit-file run, build, and check from outside that directory. Alternatively, use a complete package manifest. emit and trace do not use this preflight.