Skip to main content
The leo new command creates a new Leo project with the standard directory structure and template files.

Syntax

Arguments

string
required
The name of the package to create. This will be used as the program name and directory name.

Options

string
default:"testnet"
Name of the network to use. Options: mainnet, testnet, canary.
string
default:"http://localhost:3030"
Endpoint to retrieve network state from.

Examples

Create a New Project

This creates a directory structure:

Create with Network Configuration

Project Structure

program.json

The manifest file contains project metadata:

src/main.leo

The main program file includes a template:

.env

Environment variables for development:
The .env file is automatically added to .gitignore to prevent committing sensitive information.

After Creating a Project

Best Practices

  • Use lowercase with underscores for project names (e.g., my_program)
  • The project name becomes the program identifier with .aleo suffix
  • Review the generated program.json and update the description and license
  • Add your private key to .env for development (never commit this file)
Never use production private keys in .env files. Use test keys for development.

Next Steps