Stoffel CLI App Workflow
Scope: AI-agent-agnostic playbook for building applications with the Stoffel framework. This is not a maintainer guide for compiler, VM, protocol, or release engineering work. Dependency assumption: use the public 0.1.0 install snippets from these docs. When developing against a local checkout, make that source-based workflow explicit.
Use when
Use this playbook when building, running, testing, inspecting, or troubleshooting a Stoffel application through thestoffel command.
Current source of truth
crates/stoffel-cli/src/main.rscrates/stoffel-cli/src/project.rscrates/stoffel-cli/tests/cli.rscrates/stoffel-rust-sdk/src/input_file.rs
Core commands
stoffel run, build, and compile accept a project directory, source directory, single .stfl file, or existing .stflb depending on the command. build.source may point at either a file or a source directory; when it is a directory, the CLI recursively compiles all src/**/*.stfl files.
Project config shape
A typical app hasStoffel.toml:
[package].nameand[package].versionmust be non-empty.package.namemay use only letters, numbers,-, and_.build.sourcemust be a relative.stflfile path or a relative source directory inside the app.build.target_dirmust be a relative directory inside the app and cannot be undersrc/.optimization_levelmust be0..3.parties,threshold, andinstance_idmust be unquoted positive whole numbers.- HoneyBadger requires Byzantine topology: at least
4 * threshold + 1parties, with the current default of5parties and threshold1.
Backend and curve flags
Project config and CLI overrides support:--protocol aliases --backend; --curve aliases --field in CLI parsing. HoneyBadger does not take a curve suffix.
App templates
Usestoffel init --help for current template names. Current app-facing templates include:
Inputs
Named function inputs use repeated--input flags:
--client-input flags. Repeating the same slot appends values in order for that client:
--input a=1,b=2.
Input files
Both named inputs and ClientStore inputs can be loaded from.json, .csv, or .txt.
Named inputs:
0x-prefixed bytes depending on the execution path.
Bytecode and inspection
--program-info on run prints function/instruction metadata and client IO metadata before execution.
Validation / done criteria
For a CLI workflow change or app setup, collect real output from:# run-args: header when present.
Common pitfalls
stoffel run --configexpects network/off-chain config, not projectStoffel.toml.stoffel initcreates a project directory, not a single file.- If a path already contains
Stoffel.toml, usestoffel statusorstoffel run; do not re-init unless intentionally refreshing template files with--force. - Do not pass named inputs to ClientStore programs or ClientStore inputs to normal function-argument programs.
- Do not claim a command works unless it was actually run.