Skip to main content
The Leo CLI provides a comprehensive set of commands for developing, building, testing, and deploying Aleo programs.

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:
string
Private key to use for transactions. Overrides the PRIVATE_KEY environment variable.
Use APrivateKey1zkp8CZNn3yeCseEtxuVPbDCwSyhGW6yZKUYKfgXmcpoGPWH for local devnets only. NEVER use this key in production.
string
Network type to use: mainnet, testnet, or canary. Overrides the NETWORK environment variable.
string
Endpoint URL for network operations. Overrides the ENDPOINT environment variable.
  • Use https://api.explorer.provable.com/v1 for live networks
  • Use http://localhost:3030 for local devnets
boolean
Whether the network is a devnet. Defaults to the DEVNET environment variable.
string
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 transactions
  • NETWORK - Default network (mainnet, testnet, canary)
  • ENDPOINT - Default network endpoint
  • DEVNET - Whether the network is a devnet
  • CONSENSUS_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

Building & Testing

Execution

Deployment

Development Tools

Network Operations

Dependencies

Getting Help

Get help for any command:

Verbose Output

Use the RUST_LOG environment variable for detailed logging: