stoffel CLI is the entry point for building with Stoffel. Use it to create projects, check source, build bytecode, run clear checks, and exercise local MPC development flows.
stoffel to ~/.local/bin by default. Add it to your path if your shell does not find it:
Commands
| Command | Alias | Purpose |
|---|---|---|
init | new | Create a new Stoffel project from a template. |
check | Validate source and project MPC settings without writing bytecode. | |
compile | Write compiled bytecode for a project or source file; can also disassemble .stflb. | |
build | Build project bytecode under target/. | |
run | exec, execute | Run a project directory, .stfl source file, or .stflb bytecode file. |
dev | Watch a project and rerun it on local MPC when files change. | |
test | Run no-argument Stoffel test functions. | |
status | doctor | Show project health and environment status. |
clean | Remove generated build artifacts. | |
update | upgrade | Check or update the CLI and project dependencies. |
Create a project
--force writes template files into an existing directory without deleting unrelated files.
Project structure
The default template currently creates:Stoffel.toml records package, MPC, and build settings:
backend selects the MPC backend recorded in generated bytecode:
| Value | Use when |
|---|---|
honeybadger | You want the default field-arithmetic MPC backend. |
avss | You want AVSS with the default curve. |
avss:<curve> | You want AVSS over a specific curve, for example avss:secp256k1. |
backend = "avss" and set curve = "ed25519", curve = "secp256k1", or another supported curve in the [mpc] table. See MPC Protocols for backend selection guidance.
Check source
Validate source and MPC settings without writing bytecode:Compile bytecode
Compile a project or source file to Stoffel bytecode:--output/--out: write to a specific.stflbfile when compiling one source file.--print-ir: print compiler intermediate representation.-O,--opt-level: set optimization level, for example-O3.--optimize: use O2 unless--releaseselects O3.--release: write undertarget/releaseand use O3 unless overridden.--backend,--field,--parties,--threshold,--instance-id: override project MPC settings for this compile. Use--backend honeybadgerfor the default field-MPC backend, or--backend avss --field <curve>/--backend avss:<curve>for AVSS.
Build a project
build writes bytecode under target/ using project settings:
Run source or bytecode
Run the current project:--entry: function to execute; defaults tomain.--input NAME=VALUE: named function argument, repeat once per argument.--input-file FILE: load named inputs from.json,.csv, or.txt.--client-input SLOT=VALUE: local ClientStore input for programs that callClientStore.take_share.--client-input-file FILE: load ClientStore inputs from.json,.csv, or.txt.--expected-output-clients N: declare local output-capable client slots0..N-1.--local: run on the local MPC test network; this is the default unless--networkor--configis set.--network --config FILE: connect to an MPC network described by a network/off-chain client TOML file.--program-info: print function and instruction metadata before executing.--timeout-secs N: local MPC timeout; defaults to 180 seconds.
Local MPC development
Run the project once through the local MPC test network:--once:
stoffel dev watches Stoffel.toml and the configured source tree, rebuilds, and reruns when a .stfl file or project config changes. Use --poll-ms to tune reload latency.
Rust wrapper
The default Rust template includessrc/main.rs as an application wrapper. It imports stoffel::prelude::*, loads the generated binding metadata, compiles or loads the project program, sets local MPC topology with parties and threshold, and calls .execute_local().await? for local MPC testing.
For application-style examples, prefer building bytecode with stoffel build and loading the resulting .stflb from Rust with Stoffel::load_file("target/debug/<project>.stflb")?.
Template status
The Rust SDK path is the primary application workflow. Python and Solidity templates are useful for integration planning; use their generated README files and the current repository when validating a deployment.Troubleshooting
The command accepts an option but my generated project fails
Check the generatedREADME.md and src/main.stfl. Template programs vary: some expect named function inputs with --input, while ClientStore examples expect local client inputs with --client-input.