The Leo CLI provides a comprehensive set of commands for developing, building, testing, and deploying Aleo programs.Documentation Index
Fetch the complete documentation index at: https://mintlify.com/provablehq/leo/llms.txt
Use this file to discover all available pages before exploring further.
Installation
Install the Leo CLI using the installation guide in the Getting Started section.Command Structure
All Leo commands follow the structure:Global Options
The following options are available across multiple commands:Private key to use for transactions. Overrides the
PRIVATE_KEY environment variable.Network type to use:
mainnet, testnet, or canary. Overrides the NETWORK environment variable.Endpoint URL for network operations. Overrides the
ENDPOINT environment variable.- Use
https://api.explorer.provable.com/v1for live networks - Use
http://localhost:3030for local devnets
Whether the network is a devnet. Defaults to the
DEVNET environment variable.Custom consensus heights (comma-separated). Only use with custom devnets.
Environment Variables
Leo reads configuration from environment variables and.env files:
PRIVATE_KEY- Default private key for transactionsNETWORK- Default network (mainnet, testnet, canary)ENDPOINT- Default network endpointDEVNET- Whether the network is a devnetCONSENSUS_VERSION_HEIGHTS- Custom consensus heights
Common Patterns
Development Workflow
Using Environment Files
Create a.env file in your project:
Working with Dependencies
Command Categories
Project Management
leo new- Create new Leo projectleo clean- Clean build artifactsleo update- Update Leo CLI
Building & Testing
Execution
leo run- Execute programs locallyleo execute- Execute programs on-chain
Deployment
leo deploy- Deploy programs to networkleo upgrade- Upgrade existing programs
Development Tools
leo devnet- Run local devnetleo devnode- Run local devnodeleo fmt- Format Leo source filesleo abi- Generate ABI from bytecodeleo synthesize- Generate proving/verifying keys
Network Operations
leo query- Query network dataleo account- Manage Aleo accounts
Dependencies
leo add- Add dependenciesleo remove- Remove dependencies
Getting Help
Get help for any command:Verbose Output
Use theRUST_LOG environment variable for detailed logging: