spl-forge 0.1.0

A CLI toolkit for creating and managing SPL assets on Solana
Documentation

spl-forge

Simple CLI to create and manage SPL assets on Solana.

What It Does

  • Setup and manage local CLI config
  • Create mint accounts
  • Create token/NFT flows (market/pool/launch planned)

Quick Start

Build and run:

cargo check
spl-forge help

On first run, config is auto-created under ~/.config/spl-forge/.

Command Usage

General form:

spl-forge <command> <subcommand> [flags]

Commands

help

spl-forge help

config

Get current config:

spl-forge config get

Quick network switch (recommended):

spl-forge config set devnet
spl-forge config set localhost
spl-forge config set mainnet

These presets update RPC URL, WebSocket URL, and commitment together.

Set custom RPC URL:

spl-forge config set --url https://api.devnet.solana.com

Use Solana CLI wallet keypair:

spl-forge config set --keypair solana-cli

Reset config:

spl-forge config reset

wallet

Show active wallet address:

spl-forge wallet address

Show active wallet balance:

spl-forge wallet balance

Show balance for any wallet:

spl-forge wallet balance --address <PUBKEY>

Show full wallet status:

spl-forge wallet status

Request SOL airdrop (devnet/localnet only):

spl-forge wallet airdrop 2

create mint

spl-forge create mint \
  --mint-authority <PUBKEY> \
  --decimals <DECIMALS> \
  --initial-supply <AMOUNT> \
  [--freeze-authority <PUBKEY>]

create metadata

spl-forge create metadata \
  --mint-address <MINT_PUBKEY> \
  --name "My Token" \
  --symbol "MTK" \
  --uri "https://example.com/metadata.json" \
  --immutable

create token

spl-forge create token \
  --name "My Token" \
  --symbol "MTK" \
  --decimals <DECIMALS> \
  --initial-supply <AMOUNT> \
  --uri "https://example.com/metadata.json" \
  [--freeze-authority <PUBKEY>] \
  [--immutable]

create nft

spl-forge create nft \
  --name "My NFT" \
  --symbol "MNFT" \
  --uri "https://example.com/nft.json" \
  [--freeze-authority <PUBKEY>] \
  [--collection-mint <PUBKEY>] \
  [--immutable]

Planned (not implemented yet)

  • create market
  • create pool
  • create launch

Testing

Quick compile check:

cargo check

Run normal smoke tests:

cargo test --test commands_smoke -- --nocapture

Run aggressive localnet sweep:

cargo test --test commands_localnet -- --nocapture

Notes:

  • Localnet tests expect solana-test-validator on 127.0.0.1:8899.
  • commands_smoke skips localnet-only create checks if validator is not reachable.
  • create metadata, create token, and create nft are currently expected to fail in tests until metadata support is re-enabled.