<div align="center">
<img src="assets/logo.png" alt="Pinoc CLI Logo" width="20%">
<h1>Pinoc</h1>
<p><strong>Setup Solana Pinocchio projects blazingly fast โก</strong></p>
[](https://crates.io/crates/pinoc)
[](https://opensource.org/licenses/Apache-2.0)
[](https://www.rust-lang.org)
[](https://crates.io/crates/pinoc)
**Built by:**
<a class="header-badge" target="_blank" href="https://twitter.com/AyushAgr91">
<img alt="Twitter" src="https://img.shields.io/badge/@AyushAgr91-000000?style=for-the-badge&logo=x&logoColor=white">
</a>
<a class="header-badge" target="_blank" href="https://twitter.com/4rjunc">
<img alt="Twitter" src="https://img.shields.io/badge/@4rjunc-000000?style=for-the-badge&logo=x&logoColor=white">
</a>
</div>
---
## ๐ What is Pinoc?
A modern Rust CLI to bootstrap Solana [Pinocchio](https://github.com/anza-xyz/pinocchio) programs with built-in build, deploy, and testing tools.
### Why Pinoc?
- **Zero Configuration**: Get started in seconds with sensible defaults
- **Best Practices**: Project structure follows Solana development conventions
- **Developer Experience**: Intuitive commands that feel natural
- **Production Ready**: Built-in testing, deployment, and key management
## โจ Key Features
- ๐๏ธ **Instant Project Scaffolding** - Create production-ready projects in seconds
- ๐ **Optimized Structure** - Best-practice directory layout out of the box
- ๐จ **Unified Commands** - Build, test, and deploy with simple commands
- ๐งน **Smart Cleaning** - Clean build artifacts while preserving keypairs
- ๐ฆ **Package Discovery** - Find and add Pinocchio packages effortlessly
- ๐งช **Built-in Testing** - Comprehensive testing with mollusk-svm
- ๐ **Keypair Management** - Automatic generation and secure storage
- ๐ **Program ID Sync** - Keep your program IDs consistent automatically
- โ๏ธ **Configuration Management** - Simple deployment configuration with Pinoc.toml
## ๐ฆ Installation
### Quick Install (Recommended)
```bash
cargo install pinoc
```
### Alternative Methods
<details>
<summary>From GitHub (Latest)</summary>
```bash
cargo install --git https://github.com/a91y/pinoc --force
```
</details>
<details>
<summary>From Source</summary>
```bash
git clone https://github.com/a91y/pinoc.git
cd pinoc
cargo build --release
cargo install --path .
```
</details>
## ๐ฏ Quick Start
```bash
# Install pinoc
cargo install pinoc
# Create a new project
pinoc init my_awesome_app
# Navigate to your project
cd my_awesome_app
# Build and test
pinoc build
pinoc test
# Deploy to Solana
pinoc deploy
```
That's it! You now have a fully functional Solana program ready for development.
## ๐ Command Reference
| `pinoc init <name>` | Create a new project | `pinoc init my_app` |
| `pinoc build` | Build your program | `pinoc build` |
| `pinoc test` | Run tests | `pinoc test` |
| `pinoc deploy` | Deploy to Solana | `pinoc deploy --cluster devnet` |
| `pinoc clean` | Clean build artifacts | `pinoc clean` |
| `pinoc add <package>` | Add a package | `pinoc add some_package` |
| `pinoc search [query]` | Search packages | `pinoc search database` |
| `pinoc keys list` | List program keypairs | `pinoc keys list` |
| `pinoc keys sync` | Sync program IDs | `pinoc keys sync` |
| `pinoc help` | Show help | `pinoc help` |
### Command Options
- `pinoc init <name> --no-git` - Skip git initialization
- `pinoc init <name> --no-boilerplate` - Create minimal project structure
- `pinoc clean --no-preserve` - Clean everything including keypairs
- `pinoc deploy --cluster <cluster> --wallet <path>` - Override deployment settings
## ๐ Project Structure
### Standard Project
```
my_project/
โโโ Cargo.toml # Project configuration
โโโ README.md # Documentation
โโโ .gitignore # Git ignore rules
โโโ Pinoc.toml # Deployment configuration
โโโ src/
โ โโโ lib.rs # Main library
โ โโโ entrypoint.rs # Program entrypoint
โ โโโ errors.rs # Error definitions
โ โโโ instructions/ # Program instructions
โ โ โโโ mod.rs
โ โ โโโ initialize.rs
โ โโโ states/ # Account states
โ โโโ mod.rs
โ โโโ state.rs
โ โโโ utils.rs
โโโ tests/
โ โโโ tests.rs # Unit tests
โโโ target/deploy/
โโโ my_project-keypair.json # Program keypair
```
### Minimal Project (`--no-boilerplate`)
Perfect for quick prototypes or learning:
```
my_minimal_project/
โโโ Cargo.toml # Minimal configuration
โโโ README.md # Basic documentation
โโโ .gitignore # Git ignore rules
โโโ Pinoc.toml # Deployment configuration
โโโ src/
โ โโโ lib.rs # Minimal program structure
โโโ target/deploy/
โโโ my_minimal_project-keypair.json
```
## ๐ง Advanced Usage
### Configuration Management
Pinoc uses `Pinoc.toml` for deployment settings:
```toml
[provider]
cluster = "localhost"
wallet = "~/.config/solana/id.json"
```
Override settings per deployment:
```bash
# Deploy to devnet with custom wallet
pinoc deploy --cluster devnet --wallet ./custom-keypair.json
```
### Key Management
Keep your program IDs synchronized:
```bash
# Check key consistency
pinoc keys list
# Sync program ID in lib.rs with keypair
pinoc keys sync
```
Example output:
```
โ
Program key is already consistent!
๐ Program ID: 9WzDXwBbmkg8ZTbNMqUxvQRAyrZzDsGYdLVL9zYtAWWM
๐ No update needed in src/lib.rs
```
### Smart Cleaning
Clean build artifacts while preserving important files:
```bash
# Clean target directory (preserves keypairs)
pinoc clean
# Clean everything including keypairs
pinoc clean --no-preserve
```
## ๐ Prerequisites
Ensure you have these tools installed:
- **Rust** (1.70+) - [Install here](https://rustup.rs/)
- **Solana CLI** - [Install guide](https://docs.solana.com/cli/install-solana-cli-tools)
- **Git** - For version control
## ๐ค Contributing
We welcome contributions! Here's how to get started:
1. **Fork** the repository
2. **Create** a feature branch (`git checkout -b feature/amazing-feature`)
3. **Make** your changes
4. **Test** thoroughly
5. **Commit** with clear messages (`git commit -m 'Add amazing feature'`)
6. **Push** to your branch (`git push origin feature/amazing-feature`)
7. **Open** a Pull Request
### Development Setup
```bash
git clone https://github.com/a91y/pinoc.git
cd pinoc
cargo build --release
cargo install --path .
# Test your changes
pinoc init test-project
cd test-project
pinoc build
```
## ๐ License
This project is licensed under the Apache License 2.0 - see the [LICENSE](LICENSE) file for details.
## ๐ Support & Community
- ๐ **Documentation**: [Pinocchio Docs](https://github.com/anza-xyz/pinocchio)
- ๐ **Issues**: [GitHub Issues](https://github.com/a91y/pinoc/issues)
- ๐ฌ **Discussions**: [GitHub Discussions](https://github.com/a91y/pinoc/discussions)
- ๐ฆ **Crates.io**: [pinoc](https://crates.io/crates/pinoc)
---
<div align="center">
<p>Made with โค๏ธ by the Solana community</p>
<p>โญ Star us on GitHub if Pinoc helps you build faster!</p>
</div>