CLI Commands
Global Flags
Section titled “Global Flags”These flags apply to all subcommands:
| Flag | Description |
|---|---|
--error-format <fmt> | Diagnostic output format: human (default), json, or short. See Diagnostics & Warnings |
--no-config | Disable achronyme.toml loading. All values come from CLI flags and defaults |
init — Create a new project
Section titled “init — Create a new project”Scaffolds a new Achronyme project with achronyme.toml, source directory, and .gitignore.
ach init my-circuitach init my-app --template vmArguments
Section titled “Arguments”| Argument | Description |
|---|---|
<name> | Project name (must match [a-zA-Z_][a-zA-Z0-9_-]*) |
| Flag | Description |
|---|---|
--template <tpl> | Project template: circuit (default), vm, or prove |
Templates
Section titled “Templates”circuit— A standalone circuit withpublic/witnessdeclarations andassert_eqvm— A general-purpose program withprint()prove— A mixed program with an inlineprove {}block
Generated structure
Section titled “Generated structure”my-circuit/├── achronyme.toml├── src/│ └── main.ach└── .gitignoreSee Project Configuration for the achronyme.toml reference.
run — Execute a program
Section titled “run — Execute a program”Runs an Achronyme source file (.ach) or compiled binary (.achb).
ach run script.achach run script.achbach run # uses [project].entry from achronyme.tomlIf <path> is omitted, the CLI resolves the entry file from [project].entry in achronyme.toml.
| Flag | Description |
|---|---|
--stress-gc | Run GC on every allocation (for testing). See Stress GC Mode |
--max-heap <size> | Set maximum heap size (e.g., 256M, 1G, 512K). Raises HeapLimitExceeded if exceeded |
--gc-stats | Print GC statistics to stderr after execution. See GC Statistics |
--prove-backend <backend> | Backend for prove {} blocks: r1cs (default) or plonkish |
Examples
Section titled “Examples”ach run hello.achach run hello.ach --prove-backend plonkishach run hello.ach --max-heap 256M --gc-statsach run # from project with achronyme.tomlcircuit — Compile a ZK circuit
Section titled “circuit — Compile a ZK circuit”Compiles an Achronyme circuit source file into R1CS/Plonkish constraints and generates a witness.
ach circuit circuit.ach --inputs "x=42,y=7"ach circuit --inputs "x=42,y=7" # uses entry from achronyme.tomlSee Circuit Options for all available flags.
compile — Compile to bytecode
Section titled “compile — Compile to bytecode”Compiles an Achronyme source file into a binary (.achb) that can be run with ach run.
ach compile script.ach --output script.achbach compile --output script.achb # uses entry from achronyme.toml| Flag | Description |
|---|---|
--output <path> | Output file path (optional — can be set in [build.output].binary in achronyme.toml) |
disassemble — Show bytecode
Section titled “disassemble — Show bytecode”Disassembles an Achronyme source file or binary, showing the bytecode instructions.
ach disassemble script.achach disassemble # uses entry from achronyme.tomlrepl — Interactive mode
Section titled “repl — Interactive mode”Starts an interactive Read-Eval-Print loop. (Not yet implemented.)