The Package Manager
Fe includes built-in package management through the fe command-line tool. This handles project creation, building, and dependency resolution.
Core Commands
Section titled “Core Commands”Creating Projects
Section titled “Creating Projects”fe new my_projectcd my_projectfe testfe new creates fe.toml and a starter src/lib.fe. Use fe new --workspace my_workspace to create a workspace root instead.
Building Projects
Section titled “Building Projects”Compile your Fe project:
fe buildThis compiles all source files in src/ and resolves dependencies defined in fe.toml.
Checking Code
Section titled “Checking Code”Verify your code compiles without producing output:
fe checkUseful for quick validation during development.
Dependency Resolution
Section titled “Dependency Resolution”When you build a project, the Fe compiler:
- Reads
fe.tomlto find dependencies - Resolves local path dependencies from the filesystem
- Fetches git dependencies from remote repositories
- Compiles dependencies before your project
- Makes dependency exports available for import
Workflow
Section titled “Workflow”A typical development workflow:
- Create project structure with
fe.tomlandsrc/lib.fe - Add dependencies to
fe.tomlas needed - Write code in
src/directory - Build with
fe buildto compile and check for errors - Iterate on your code
Build Output
Section titled “Build Output”Fe uses the Sonatina backend. By default, fe build writes creation bytecode, runtime bytecode, and ABI JSON to the project’s out/ directory. Select artifacts explicitly with --emit:
fe build --emit abi,metadatafe build --contract Counter --out-dir buildfe build -O 2Optimization defaults to 1; 0, 1, 2, and s are accepted. Use fe build --help for the complete artifact list.
Rebuilding from Metadata
Section titled “Rebuilding from Metadata”Fe can reconstruct a build from the self-contained recompilation input emitted as <Contract>.metadata.json:
fe build --emit metadatafe build --from-metadata out/Counter.metadata.json --out-dir rebuiltThis uses the recorded project, target contract, and optimization settings. Use the recorded compiler version for reproducibility; a version mismatch only warns. An explicit optimization override can change the bytecode. --from-metadata - reads JSON from standard input.
Formatting and Dependencies
Section titled “Formatting and Dependencies”fe fmtfe fmt --checkfe treefe fmt --check reports formatting differences without rewriting files. fe tree shows dependency resolution. Git dependencies are fetched automatically when you build or check. There is no central package registry: ingots are shared as local paths or git repositories (see Publishing).
Error Messages
Section titled “Error Messages”The Fe compiler provides helpful error messages:
error: Cannot find value `undefined_var` in this scope --> src/lib.fe:10:5 |10 | undefined_var | ^^^^^^^^^^^^^ not found in this scopeUse these messages to locate and fix issues in your code.
Next Steps
Section titled “Next Steps”See Dependencies to learn how to add external ingots to your project.
Experimental Native Executables
Section titled “Experimental Native Executables”The compiler also has an experimental native backend for programs with pub fn main() -> i32, on x86-64 Linux and AArch64 macOS. Fe 26.4 supports standalone files and whole workspaces, including dependencies. It requires a compiler built with the cranelift feature:
# Run in the compiler source checkoutcargo build --release -p fe --features cranelift./target/release/fe build --backend native hello.feThis is separate from deploying EVM contracts. Native builds require the additional compiler feature; fe test --backend native executes native tests. std::io provides host character I/O, and std::native includes checked process-argument access through Args, process CPU timing, and an explicitly owned ByteBuffer with fallible growth and explicit release.