npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

solana-better-cli

v1.0.3

Published

A comprehensive Solana wallet management CLI tool with portfolio tracking, token swapping, and more

Readme

Solana Better CLI

A comprehensive Solana wallet management CLI tool with portfolio tracking, token swapping, and more.

Features

  • 🏦 Wallet Management: Generate new wallets, load existing ones from private keys (JSON array, base58, or files), and manage multiple accounts
  • 💰 Portfolio Tracking: View your complete Solana portfolio with real-time balances
  • 🔄 Token Swapping: Swap tokens using Jupiter aggregator for best rates
  • 💸 SOL Transfers: Send SOL to other addresses with optional memos
  • 🎁 SOL Wrapping: Wrap and unwrap SOL to/from WSOL
  • 📊 Balance Checking: Check SOL and token balances individually or all at once
  • 🎯 Interactive CLI: User-friendly command-line interface with guided workflows

Installation

Global Installation (Recommended)

npm install -g solana-better-cli

Local Installation

npm install solana-better-cli

Usage

Quick Start

# Start the interactive wallet manager
solana-better start

# Or use the short alias
sol start

Available Commands

# Generate a new wallet
solana-better create-wallet

# Generate and save wallet to file
solana-better create-wallet -o wallet.json

# Initialize wallet from private key
solana-better init "[1,2,3,...]"  # JSON array format
solana-better init "base58string" # Base58 format
solana-better init wallet.json    # File path

# Initialize and save to file
solana-better init "[1,2,3,...]" -s my-wallet.json

# Start interactive mode
solana-better start

# Show help
solana-better --help

Interactive Features

Once you start the tool, you'll have access to:

  1. Wallet Setup

    • Generate new wallet
    • Load from private key
    • Load from file
  2. Main Operations

    • View Portfolio
    • Transfer SOL
    • Wrap/Unwrap SOL
    • Swap Tokens
    • Check Balance
    • Change Wallet

Configuration

The tool uses environment variables for configuration. Create a .env file in your project root:

# Solana RPC URL (default: https://api.mainnet-beta.solana.com)
RPC_URL=https://api.mainnet-beta.solana.com

# Your private key (optional, for automated usage)
PRIVATE_KEY=[your-private-key-array]

# Commitment level (default: confirmed)
COMMITMENT=confirmed

CLI Configuration Options

You can also configure the tool directly from the command line without environment variables:

# Use a custom RPC endpoint
solana-better --rpc-url https://api.devnet.solana.com start

# Switch to testnet
solana-better --network testnet start

# Use a different commitment level
solana-better --commitment finalized start

# Set custom slippage and priority fee
solana-better --slippage 500 --priority-fee 2000 start

# Combine multiple options
solana-better --rpc-url https://api.testnet.solana.com --network testnet --commitment processed start

Available CLI Options

  • -r, --rpc-url <url> - Custom RPC URL (default: https://api.mainnet-beta.solana.com)
  • -n, --network <network> - Solana network (mainnet-beta, testnet, devnet)
  • -c, --commitment <level> - Commitment level (confirmed, finalized, processed)
  • --slippage <bps> - Slippage tolerance in basis points (default: 300)
  • --priority-fee <lamports> - Priority fee in lamports (default: 1000)

Network-Specific RPC URLs

Here are some common RPC endpoints you can use:

  • Mainnet: https://api.mainnet-beta.solana.com
  • Testnet: https://api.testnet.solana.com
  • Devnet: https://api.devnet.solana.com
  • Local: http://localhost:8899

Examples

Generate a New Wallet

solana-better create-wallet -o my-wallet.json

Transfer SOL

solana-better start
# Then select "Transfer SOL" from the menu

Swap Tokens

solana-better start
# Then select "Swap Tokens" from the menu

Initialize from Private Key

# From JSON array
solana-better init "[1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64]"

# From base58 string
solana-better init "5KQwrPbwdL6PhXujxW37FSSQZ1JiwsST4cqQzDeyXtrP1V5xih"

# From file
solana-better init wallet.json

Development

Prerequisites

  • Node.js 16+
  • npm or yarn

Setup

# Clone the repository
git clone https://github.com/yourusername/solana-better-cli.git
cd solana-better-cli

# Install dependencies
npm install

# Build the project
npm run build

# Run in development mode
npm run dev

Scripts

  • npm run build - Build the TypeScript project
  • npm run start - Run the built version
  • npm run dev - Run in development mode with ts-node
  • npm run clean - Clean the dist folder

Publishing

To publish to npm:

# Login to npm (if not already logged in)
npm login

# Publish the package
npm publish

Contributing

  1. Fork the repository
  2. Create a feature branch
  3. Make your changes
  4. Add tests if applicable
  5. Submit a pull request

License

MIT License - see LICENSE file for details.

Support

  • Create an issue on GitHub
  • Check the documentation
  • Join our community discussions

Disclaimer

This tool is for educational and development purposes. Always test with small amounts before using with significant funds. The developers are not responsible for any financial losses.