Cargo.toml and sifr.toml. While Cargo.toml handles distribution concerns such as registries, lockfiles, and publishing credentials, sifr.toml is where you configure everything the Sifr compiler cares about: your package name, edition, required compiler version, source root, scripts, and trust policy for backend Rust crates. This page covers every section of sifr.toml and explains what belongs there rather than in Cargo.toml.
A complete sifr.toml example
[package] — identity and compiler requirements
The [package] section identifies your package to the Sifr compiler and locks it to a compatible compiler range.
| Key | Required | Description |
|---|---|---|
name | Yes | The Sifr package name. Use snake_case. |
version | Recommended | SemVer version string. Required for publishing. |
edition | Yes | The Sifr language edition. Currently "2026". |
sifr-version | Recommended | Version requirement for the Sifr compiler. Use a range such as ">=0.3,<0.4" to express compatibility. |
default-run | No | Name of the default src/bin/*.sifr target when sifr run finds more than one. |
The
name in sifr.toml is the Sifr package name used for imports and diagnostics. The Cargo package name in Cargo.toml follows the sifr-<kebab-case-name> convention and is distinct — do not assume they are the same string.[package] section for a library package looks like this:
[source] — source roots
The [source] section tells Sifr where to find your .sifr source files.
roots defaults to ["src"] for production packages — you can omit the section entirely in a standard layout. You only need to specify roots explicitly when your source files live outside src/, which is an uncommon scenario reserved for legacy migration or non-standard project shapes.
[format] — formatter settings
The [format] section configures the Sifr source formatter. Settings here apply when you run sifr fmt.
[lint] — lint configuration
The [lint] section controls which diagnostics the Sifr linter reports. You can select lint rule sets and suppress specific codes.
[scripts] — structured command plans
Scripts let you define reusable Sifr command sequences and invoke them with sifr run --script <name>. Each entry is a structured Sifr command plan — not a shell string.
SIFR-PACKAGE-0605 and requires you to disambiguate with --bin or --script.
What goes in Cargo.toml vs sifr.toml
Knowing where to put configuration prevents confusion and keeps Sifr’s tooling working correctly. Put insifr.toml:
- Package name, edition,
sifr-version - Source root (
[source].roots) - Formatter and lint configuration
- Named scripts
- Native trust policy for backend Rust crates
Cargo.toml:
- Distribution metadata (description, authors, license, repository URL)
- Dependency declarations (
[dependencies],[dev-dependencies]) - Registry and Git/path source configuration
includeandexcludearchive rules for publishing- Workspace configuration
- Publishing credentials (never in
sifr.tomlor any Sifr-generated output)
cargo metadata --format-version 1, locates sifr.toml via the pointer below, and derives the Sifr package graph from Cargo’s resolved dependency graph:
Keeping Cargo.toml in sync with sifr repair
If your Cargo.toml gets out of sync with what Sifr expects — for example after a manual edit or a merge conflict — you can check for drift without writing any files:
Cargo.toml entries and restore a missing pure marker: