Starpin CLI
A command-line interface for creating and managing Star Frame Solana programs.
Installation
From Source
# Add target/release/starpin to your PATH
Using Cargo
Usage
Initialize a New Project
Create a new Star Frame project using the counter template:
Create a project with a specific template:
Create a project in a specific directory:
Available templates:
counter- Full-featured counter with create, update, increment, decrement, and close operationssimple_counter- Basic counter with just initialize and increment (perfect for learning)marketplace- Advanced order book marketplace with SPL token integration
Build Your Program
Build for localnet (default):
Build for specific network:
Skip automatic IDL generation:
Test Your Program
Run all tests (localnet):
Run tests against specific network:
Run tests with a filter:
Deploy Your Program
Deploy to devnet (default):
Deploy to specific network:
Upgrade an existing program:
Generate IDL
Generate IDL files for client libraries:
Generate IDL to a specific directory:
Check Network Configuration
View current Solana network settings:
Generate New Program Keys
Generate a new random program ID (like anchor keys list):
Generate keys for a specific program:
Sync Program IDs
Synchronize program IDs between Starpin.toml and lib.rs (like anchor keys sync):
Use program ID from lib.rs as source of truth:
Features
- ✅ Project template generation
- ✅ Type-safe Star Frame program templates
- ✅ Integrated build system with automatic IDL generation
- ✅ Multi-network support (localnet/devnet/mainnet)
- ✅ Testing utilities with network configuration
- ✅ Network-aware deployment
- ✅ Professional network management
- ✅ Configuration files (Starpin.toml)
- ✅ Program key management (generate/sync)
- ✅ Automatic program ID synchronization
Project Structure
Generated projects include:
my_project/
├── Cargo.toml # Rust manifest with Star Frame dependencies
├── Starpin.toml # Network and deployment configuration
├── src/
│ ├── lib.rs # Main program logic
│ └── main.rs # Binary entry point
├── tests/
│ └── counter.rs # Test files
├── README.md # Project documentation
└── .gitignore # Git ignore patterns
Templates Overview
Counter Template (Advanced)
- Create Counter: Initialize with owner, signer, and optional starting value
- Update Signer: Change the authorized signer for the counter
- Count: Add or subtract amounts with validation
- Close Counter: Clean up and recover rent
- Full validation: Advanced authority and state management
Simple Counter Template (Beginner)
- Initialize: Create a counter with optional starting value
- Increment: Simple increment by 1 operation
- Minimal complexity: Perfect for learning Star Frame basics
- Clean code: Easy to understand and extend
Marketplace Template (Professional)
- Market Creation: Initialize markets for any SPL token pair
- Order Placement: Place buy/sell orders with price/quantity
- Order Cancellation: Cancel single or multiple orders
- Order Matching: Automatic bid/ask matching engine
- SPL Integration: Full token transfer and escrow system
- Advanced Features: Fill-or-kill orders, maker info tracking
- Production Ready: Comprehensive validation and error handling
Development
Prerequisites
- Rust 1.84.1+
- Solana CLI tools
- cargo-build-sbf (for Solana program compilation)
Building the CLI
Running Tests
Adding New Templates
- Create a new module in
src/templates/ - Implement the
Templatetrait - Add the template to the match statement in
src/commands/init.rs
Contributing
Contributions are welcome! Please:
- Fork the repository
- Create a feature branch
- Add tests for new functionality
- Ensure all tests pass
- Submit a pull request
License
MIT License - see LICENSE file for details.
Support
For issues and questions:
- Open an issue on GitHub
- Check the Star Frame documentation
- Join the Solana developer community