Run ryft --help for the compiler’s built-in help. Run all project commands from the directory containing ryft.toml unless passing an explicit source file.
Commands
| Command | Behavior |
|---|---|
ryft init DIRECTORY |
Create a project; refuses to replace an existing destination |
ryft check [SOURCE.rz] |
Parse and type-check without native compilation |
ryft build [SOURCE.rz] |
Compile and link a native program |
ryft run [SOURCE.rz] |
Build a temporary executable and run it |
ryft test [SOURCE.rz] |
Compile and run global language tests |
ryft fmt SOURCE.rz |
Format one file in place |
ryft lock |
Write local dependency content hashes to ryft.lock |
ryft lsp |
Start the stdio language server |
ryft --version |
Print the compiler version |
For check, build, run and test, omitted source selects project.entry in ryft.toml in the current working directory, otherwise main.rz. The default build output is server.exe on Windows, even for a console program. Use -o for an explicit name.
Native build options
ryft build main.rz -o app.exe
ryft build main.rz -o app.exe --emit-rust generated.rs
ryft build main.rz -o app.exe --target x86_64-pc-windows-msvc
--emit-rust retains the generated Rust source for inspection. It is not a standalone Rust project and cannot be compiled with bare rustc; it depends on the runtime manifest, lockfile and configured features. --target forwards a Rust target and requires that target’s standard library, native C compiler and linker. Only the Windows x64 preview is currently qualified for development use.
Outputs cannot overwrite the input source. Parent output directories must already exist. Builds use locked dependencies and distinct generated crate names so concurrent builds do not overwrite each other’s executable.
Forward server arguments
Arguments following -- are passed to the generated program:
ryft run main.rz -- --port 8080 --data-dir .\data --isolate
These flags belong to the native server, not to ryft build. See Windows deployment for runtime options. Console programs do not expose the HTTP server argument parser.
Formatting and tests
ryft fmt main.rz --check
ryft fmt main.rz --stdout
ryft test main.rz
--check exits with failure when formatting is needed. --stdout prints formatted text without writing the file. Formatting preserves token order, comments and literal spellings and does not require type-correct code.
Language tests use test name { ... } and assert. A failed assertion produces a failed test and nonzero exit status. Pure global functions are testable this way; request handlers and app-local storage require integration tests that run a server.
Build environment
| Variable | Purpose |
|---|---|
RYFT_CARGO |
Cargo executable override |
RYFT_RUSTC |
Rust compiler executable override |
RYFT_CACHE_DIR |
Native build cache directory |
By default the native cache is ryft-native-cache-v0.2 under the OS temporary directory. The historical folder name does not indicate the installed language version; build fingerprints include generated source, runtime manifest and lockfile. Do not share a writable build cache with untrusted accounts.
Diagnostics and exit status
Compiler errors include a code, source path, line/column and a caret span. Compilation stops at the first reported error. Warnings explain limits such as memory budgets being metadata in a shared process. A successful check does not prove deployment readiness.
Successful commands return zero. Invalid syntax, type failures, build failures and failed language tests return nonzero. run propagates the generated program’s exit status; a Ryft console main -> i64 must return a value from 0 to 255.