| Crates.io | l2-cli |
| lib.rs | l2-cli |
| version | 0.2.1 |
| created_at | 2026-01-23 15:50:22.683693+00 |
| updated_at | 2026-01-23 16:41:01.878422+00 |
| description | Command-line scaffolding tool for Ethereum L2 (Base, Optimism, Arbitrum) developers with Account Abstraction support |
| homepage | |
| repository | https://github.com/Puneeth-R-140/L2-CLI |
| max_upload_size | |
| id | 2064826 |
| size | 135,225 |
A command-line scaffolding tool for Ethereum Layer 2 application development, with first-class support for Base, Optimism, and Arbitrum networks. Features integrated Account Abstraction (ERC-4337) support for building next-generation Web3 applications with gasless transactions.
L2 CLI streamlines the process of creating production-ready applications on Ethereum Layer 2 networks. Built with Rust for performance and reliability, it provides opinionated templates and tooling to help developers ship faster. The tool includes comprehensive support for Account Abstraction on all supported networks, enabling gasless transactions and improved user experience.
cargo install l2-cli
# Clone the repository
git clone https://github.com/Puneeth-R-140/L2-CLI.git
cd L2-CLI
# Install the binary
cargo install --path .
This installs the l2 command globally on your system.
Note for Windows users: You may need to restart your terminal or add C:\Users\<username>\.cargo\bin to your PATH environment variable.
l2 --version
l2 --help
If the l2 command is not found, restart your terminal or add Cargo's bin directory to your PATH.
# Interactive mode
l2 init
# With options
l2 init my-app --network base --template react
# Arbitrum project
l2 init my-app --network arbitrum --template react
# Initialize with AA support (works on all networks!)
l2 init my-app --network base --template react --account-abstraction
l2 init my-app --network optimism --template react --account-abstraction
l2 init my-app --network arbitrum --template react --account-abstraction
This generates a complete project structure with:
--network <network>: Target L2 network (base, optimism, arbitrum)
--template <template>: Project template (javascript, react)
--account-abstraction: Enable Account Abstraction support (ERC-4337)
Note: Account Abstraction is now supported on all L2 networks! Projects are configured with the appropriate testnet (Base Sepolia, Optimism Sepolia, or Arbitrum Sepolia).
When using the --account-abstraction flag, the generated project includes:
cd my-app/contracts
forge install
forge build
forge test
Includes:
SimpleAccount.sol: ERC-4337 compatible smart accountcd my-app/frontend
npm install
npm run dev
Features:
Copy .env.example to .env and configure:
VITE_BUNDLER_URL=https://api.pimlico.io/v2/84532/rpc?apikey=YOUR_API_KEY
VITE_PAYMASTER_URL=https://api.pimlico.io/v2/84532/rpc?apikey=YOUR_API_KEY
VITE_WALLETCONNECT_PROJECT_ID=YOUR_PROJECT_ID
Get API keys:
# View current config
l2 config list
# Set a value
l2 config set <key> <value>
# Get a value
l2 config get <key>
# Reset to defaults
l2 config reset
Configuration is stored in ~/.l2-cli/config.toml.
l2 doctor
Validates your development environment, including:
my-app/
├── src/
│ ├── App.jsx
│ ├── main.jsx
│ ├── wagmi.js
│ └── index.css
├── index.html
├── vite.config.js
├── tailwind.config.js
└── package.json
my-app/
├── contracts/
│ ├── src/
│ │ └── SimpleAccount.sol
│ ├── script/
│ │ └── Deploy.s.sol
│ ├── test/
│ └── foundry.toml
├── frontend/
│ ├── src/
│ │ ├── hooks/
│ │ │ └── useSmartAccount.js
│ │ ├── components/
│ │ │ └── GaslessButton.jsx
│ │ ├── App.jsx
│ │ ├── main.jsx
│ │ └── wagmi.js
│ ├── .env.example
│ └── package.json
└── README.md
# During development
cargo run -- init my-app --network base
# After installation
l2 init my-app --network base
cargo test
cargo build --release
The binary will be available at target/release/l2.
Contributions are welcome. Please ensure:
MIT License - see LICENSE file for details.
Puneeth R
Built with Rust. Powered by Base, Optimism, Pimlico, and the Ethereum ecosystem.
For issues and feature requests, please use the GitHub issue tracker.