The Leo Command Line Interface
The Leo CLI is a command line interface tool that comes equipped with the Leo compiler.
You can print the list of commands by running leo --help
Commands
abi- Generate an ABI JSON file from a compiled.aleobytecode file.account- Create a new Aleo account, sign and verify messages.add- Add a new onchain or local dependency to the current project.build- Compile the current project.clean- Clean the build and output artifacts.deploy- Deploy a program to the Aleo network.devnet- Initialize a local devnet.devnode- Run a local lightweight devnode.execute- Execute a program and produce a transaction containing a proof.new- Create a new Leo project in a new directory.query- Query live data and state from the Aleo network.block- Query block information.transaction- Query transaction information.program- Query program source code and live mapping values.stateroot- Query the latest stateroot.committee- Query the current committee.mempool- Query transactions and transmissions from the memory pool.peers- Query peer information.
remove- Remove a dependency from the current project.run- Run a program without producing a proof.test- Run the test cases for a Leo project.update- Update to the latest version of Leo.upgrade- Upgrade a deployed program on the Aleo network.synthesize- Generate proving and verifying keys for a program.fmt- Format Leo source files. (plugin)plugins- List installed CLI plugins.
Universal Flags
These flags are available to use alongside all commands in the Leo CLI.
--help
-h
Prints available commands and flags.
--version
-V
Prints the currently installed version of Leo.
-q
Suppresses the CLI output.
-d
Prints out additional information for debugging if possible.
--disable-update-check
Disables Leo's daily check for CLI version updates.
--path <PATH>
Specifies the path to Leo program root folder. Defaults to ./.
--home <HOME>
Specifies the path to the .aleo program registry. This is where programs downloaded from the network will be cached. Defaults to ~/.aleo/registry.
--json-output[=<PATH>]
Saves structured JSON output to disk.
- Default location:
build/json-outputs/<command>.json - Custom file:
--json-output=my-results.json
The value must be attached with = (e.g. --json-output=my-results.json); with no value, the default location is used.
Supported commands: build, deploy, upgrade, run, execute, test, query, synthesize. For build, the JSON contains the program checksum and each entry/view function checksum (see leo build --checksums).
# Save to default location (build/json-outputs/run.json)
leo run --json-output main 1u32 2u32
# Save to custom path
leo execute main --json-output=my-results.json
# Write the program and function checksums to build/json-outputs/build.json
leo build --json-output
--package <NAME>
-p <NAME>
Target a specific workspace member by name. Matches the member's directory name, program name (e.g., token.aleo), or program name without the .aleo suffix. Only valid inside a workspace - errors if no workspace.json is found.