ZK Compression CLI
The Light Protocol CLI (light) is a command-line interface for interacting with compressed accounts and compressed tokens on Solana. It provides a complete toolkit for local development, testing, and production operations.
Installation
Using npm
Install the CLI globally using npm or your preferred package manager:Requires Node.js >= v20.9.0
Building from Source
If you prefer to build from source, follow these steps at the root of the monorepo:Prerequisites
You need a valid Solana filesystem wallet for the CLI to function:- Default wallet location:
~/.config/solana/id.json - The CLI uses this wallet as the default fee payer and mint authority
- Create one by following the Solana wallet documentation
Quick Start
1. Start the Test Environment
The CLI includes a complete local test environment with validator, indexer, and prover:- Solana test validator with Light Protocol programs
- Photon indexer (port 8784)
- Light prover server (port 3001)
2. Fund Your Wallet
Ensure you have sufficient localnet SOL:3. Run CLI Commands
You’re ready to interact with ZK Compression:Configuration
View or update CLI configuration for different networks:Using Devnet
To switch to Devnet with an RPC that supports ZK Compression:Command Categories
The CLI organizes commands into logical groups:Development & Testing
init- Initialize a new compressed account project from templatetest-validator- Local test environment with validator, indexer, and proverstart-prover- Run standalone prover serverconfig- Configure RPC endpoints
Token Operations
create-mint- Create compressed token mintsmint-to- Mint tokens to accountsapprove-and-mint-to- Mint via external authoritytransfer- Transfer compressed tokenscreate-token-pool- Register existing mints
Compression
compress-sol- Compress native SOLdecompress-sol- Decompress back to native SOLcompress-spl- Compress SPL tokensdecompress-spl- Decompress SPL tokens
Account Management
balance- Check compressed SOL balancetoken-balance- Check compressed token balancemerge-token-accounts- Consolidate token accounts
Getting Help
All commands support the--help flag for detailed usage:
Support
- Join the Developer Discord for help
- Check the Photon indexer documentation
- Visit Light Protocol docs
Next Steps
Test Validator
Learn about the local development environment
All Commands
Complete command reference with examples