Skip to main content

Introduction

The create-lz-oapp CLI is a command-line tool for scaffolding LayerZero Omnichain Applications (OApps). This CLI toolkit simplifies the process of building, testing, deploying, and configuring omnichain applications by providing a structured project template and essential development tools. With create-lz-oapp, you can quickly bootstrap a new LayerZero project with both Hardhat and Foundry development frameworks pre-configured, along with example contracts, crosschain unit tests, LayerZero configuration files, and deployment scripts.

Installation & Usage

Create a new LayerZero OApp project with a single command:
This will launch an interactive project creation wizard that guides you through setting up your omnichain application.

CLI Options

The create-lz-oapp CLI supports the following options:

Version Information

Output the current version number of the CLI tool.

CI Mode

Run the CLI in CI (Continuous Integration) mode, which operates in non-interactive mode. This is useful for automated deployments and scripts where user interaction is not available.
  • Default: false

Project Directory

Specify the target directory where the new project should be created. If not provided, the CLI will use the current directory or prompt for a location.

Example Project Template

Choose which example project template to use as the starting point for your application.

Always Available Examples

These examples are always available:

Feature-Flagged Examples

These examples are available only when specific environment variables are set:

Log Level

Set the verbosity level for CLI output and logging information.
  • Available choices: "error", "warn", "info", "http", "verbose", "debug", "silly"
  • Default: "info"

Package Manager

Choose which Node.js package manager to use for dependency management in your project.
  • Available choices: "npm", "pnpm", "bun"

Environment Variables for Feature-Flagged Examples

To access feature-flagged examples, you can set the corresponding environment variables inline with the command. These examples provide access to experimental, specialized, or advanced features.

Setting Environment Variables

On Unix/macOS/Linux:
On Windows (Command Prompt):
On Windows (PowerShell):

Example Usage

Basic Interactive Setup

Non-Interactive Setup with Options

Create an OFT Project

Create an ONFT721 Project

Using Feature-Flagged Examples

To use feature-flagged examples, include the required environment variable in the command:

Next Steps

After creating your project with create-lz-oapp, you’ll have a fully structured omnichain application ready for development. The generated project includes:
  • Example smart contracts implementing LayerZero standards
  • Deployment scripts and configuration
The project structure will vary depending on the example template you selected, with each template providing the appropriate contracts, tests, and configuration for that specific use case (OApp, OFT, ONFT, etc.). Refer to the generated project’s README file for specific instructions on how to configure, test, and deploy your omnichain application.