Earn 6.19% APY staking with Solana Compass + help grow Solana's ecosystem

Stake natively or with our LST compassSOL to earn a market leading APY

Sol CLI: A Solana Skill for AI Agents

Published on 2026-02-25

A Solana skill for OpenClaw, Claude Code, and AI agents. Trade tokens, manage wallets, stake SOL, earn yield, and track portfolios — no API keys, no code.

What Sol CLI Does: A Solana Skill for AI Agents

Sol CLI is a command-line tool for Solana that reads like English. Instead of constructing transactions or writing code, you say what you want:

sol token swap 50 usdc bonk          # buy a token
sol token send 2 sol GkX...abc       # pay someone
sol stake new 10                     # stake SOL and start earning
sol lend deposit 100 usdc            # deposit to earn yield
sol portfolio                        # see everything you hold

Every command works in two modes: human-readable output for people, and structured JSON for AI agents and scripts. Add --json to any command and get a predictable response your agent can parse.

No API keys. No private key environment variables. No SDK integration. Keys live locally on disk with proper file permissions.


Quick Start

Add Sol CLI as a skill for your agent, or install it globally:

# Add as an agent skill (OpenClaw, Claude Code, 37+ platforms)
npx skills add solanaguide/solana-cli

# Or install globally via npm
npm install -g @solana-compass/cli

Then create a wallet, lock down permissions, and start using it:

sol wallet create --name my-wallet
sol config set rpc.url https://your-rpc-endpoint.com

# Secure your agent before giving it access
sol config set permissions.canTransfer false
sol config set permissions.canExportWallet false
sol config status                              # review security settings
sol config lock                                # once happy, lock to prevent agent changes

# Start using it
sol wallet balance
sol token swap 10 usdc sol
sol portfolio

For platform-specific install options (ClawHub, Claude Code plugin), see install options below.


Who Uses Sol CLI: OpenClaw Bots, Claude Code Agents, and Humans

AI agents that need to transact on Solana

If you're running an OpenClaw bot, a Claude Code agent, or any LLM with shell access, Sol CLI is the fastest way to give it financial capabilities. It's available as a skill on ClawHub, as a Claude Code plugin, and via skills.sh — so your agent can discover and use it automatically.

Your agent can check prices, execute trades, manage a portfolio, and earn yield — all through simple commands with structured JSON output. It doesn't need to understand Solana's transaction model, manage program instructions, or handle blockhash expiry. It says what it wants and the CLI handles the rest.

People who prefer the command line

Sol CLI works just as well for humans. The commands are designed to read naturally, tab completion works, and the output is clean and informative. If you're the kind of person who lives in the terminal, this is for you.

Developers building agent workflows

Building an AI assistant that can handle financial tasks? Sol CLI gives you a stable interface. The --json output follows a consistent envelope format, error codes are predictable, and every operation is logged for audit.


Solana Trading, Staking, and DeFi via CLI

Trade tokens

Buy, sell, and swap any token on Solana. Prices come from Jupiter, which aggregates every DEX for the best rate. Browse trending, most-traded, and newly launched tokens to discover what's available.

sol token swap 100 usdc sol
sol token swap 50 usdc bonk --quote-only    # preview first
sol token browse trending
sol token browse stocks                     # tokenized equities

Send payments

Transfer SOL, USDC, or any Solana token to any wallet address. Use --yes to skip confirmation — useful for automated payments between agents.

sol token send 50 usdc GkX...abc
sol token send 2 sol 7nY...xyz --yes

Stake SOL

Delegate SOL to a validator and earn staking rewards. One command handles account creation, funding, and delegation. Claim MEV tips to compound your returns.

sol stake new 10
sol stake list
sol stake claim-mev

Earn yield by lending

Compare rates across five lending protocols — Kamino, MarginFi, Drift, Jupiter Lend, and Loopscale — and deposit into the best one automatically. Borrow against your deposits across any protocol. See AI Agent Financial Markets for yield strategies.

sol lend rates usdc                        # compare APY across all protocols
sol lend deposit 100 usdc                  # auto-picks best rate
sol lend deposit 5 sol --protocol kamino   # target a specific protocol
sol lend borrow 500 usdc
sol lend positions                         # everything across all protocols

Earn yield through vaults

Managed yield vaults handle strategy complexity for you. Deposit and the vault optimises returns.

sol earn                                   # list vaults with APY and TVL
sol earn deposit 100 usdc                  # deposit into best vault
sol earn positions                         # your vault positions
sol earn withdraw 50 usdc

Trade prediction markets

Browse and trade prediction markets on crypto, sports, politics, and more — powered by Jupiter. See AI Agent Prediction Markets for end-to-end workflows.

sol predict list crypto                    # browse events
sol predict search "solana"                # search by keyword
sol predict buy 5 yes POLY-701571          # buy YES contracts
sol predict positions                      # open positions with P&L

Set up recurring buys and limit orders

Automate trades with dollar-cost averaging or place orders that trigger at a target price.

sol token dca new 500 usdc sol --every day --count 10
sol token limit new 50 usdc bonk --at 0.000003

Track your portfolio

See everything in one place — tokens, staked SOL, lending positions, earn vaults, prediction markets, and open orders — all with USD values. Take snapshots to track changes over time, compare performance, and calculate profit and loss.

sol portfolio
sol portfolio snapshot --label "monday"
sol portfolio compare
sol portfolio pnl

Manage wallets

Create, import, and organise wallets. Each is a local key file with proper file permissions. The first wallet you create becomes the default for all commands.

sol wallet create --name trading
sol wallet balance
sol wallet list

AI Agent Security: Code-Level Permissions on Solana

AI agents with access to wallets are powerful — but they need guardrails. An OpenClaw bot gave away $250,000 in tokens after a social engineering attack. The Freysa AI was tricked into transferring $47,000 via prompt injection. Sol CLI addresses this with three layers of protection enforced in code, not in the AI's prompt.

13 permission flags control which commands exist. When a permission is disabled, the command is removed entirely — it can't be invoked, and no prompt injection can override it:

# ~/.sol/config.toml — example trading agent
[permissions]
canSwap = true           # allow buying and selling tokens
canTransfer = false      # prevent sending to external wallets
canExportWallet = false  # prevent key export
# ... 10 more flags covering staking, lending, borrowing, prediction markets, and more

Transaction limits cap how much the agent can spend per trade and per day:

[limits]
maxTransactionUsd = 500
maxDailyUsd = 2000

Allowlists restrict which tokens can be traded and which addresses can receive funds:

[allowlist]
tokens = "So11111111111111111111111111111111111111112,EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v"

Lock the config with sol config lock so the agent can't change its own constraints. For the full security deep-dive — including real-world incidents and recommended configurations — see Agent Permissions & Security.


Install Sol CLI: OpenClaw Skill, Claude Code Plugin, or npm

Sol CLI is open source on GitHub. Install via any of the methods below.

Global install via npm

npm install -g @solana-compass/cli
sol wallet create

Run without installing

npx @solana-compass/cli@latest wallet balance

Add as a Claude Code plugin

/plugin marketplace add solanaguide/solana-cli
/plugin install solana-payments-wallets-trading@solanaguide-solana-cli

Add as a skill (skills.sh / ClawHub)

npx skills add solanaguide/solana-cli

For OpenClaw, the skill is also available on ClawHub under solana-payments-wallets-trading.

First-time setup

sol config set rpc.url https://your-rpc-endpoint.com
sol wallet create --name my-wallet

The public RPC endpoint rate-limits aggressively. For anything beyond testing, use a dedicated RPC from Helius, Triton, or QuickNode — all offer free tiers.

Requires Node.js 20 or later.


Sol CLI vs Solana Agent Kit and Other AI Tools

vs Solana Agent Kit (SendAI)

Solana Agent Kit is a TypeScript/Python SDK for building custom agents. It's excellent for developers who want to write code that interacts with Solana programmatically. Sol CLI is a ready-to-use tool — any LLM with shell access can use it immediately, no code integration needed. They're complementary: Agent Kit for deep customisation, Sol CLI for instant capability.

vs Browser-based trading platforms

Platforms like Jupiter, Raydium, and exchange apps require a browser and manual interaction. Sol CLI works from the terminal and supports full automation via --json mode. If you want an agent to trade while you sleep, it needs a CLI, not a browser.

vs Existing Solana dev skills

Other Solana skills for AI agents focus on teaching the agent how to write Solana code — program instructions, transaction construction, account management. This fills context windows with implementation detail. Sol CLI takes the opposite approach: instead of teaching the agent to build transactions, give it a tool that already knows how.


Structured JSON Output for AI Agents

Every command supports --json. The response follows a consistent format:

{
  "ok": true,
  "data": { ... },
  "meta": { "elapsed_ms": 450 }
}

Errors are equally predictable:

{
  "ok": false,
  "error": "SWAP_FAILED",
  "message": "Insufficient balance for swap",
  "meta": { "elapsed_ms": 120 }
}

Error codes are UPPER_SNAKE_CASE identifiers. Check the ok field before reading data.


Open Source

Sol CLI is MIT licensed and open source on GitHub. Contributions, issues, and feedback are welcome.

Token swaps include a small fee (2-100 bps, typically under 10 bps) paid to the compassSOL reserve, which boosts staking yield for Solana Compass delegators.

Disclaimer: This software interacts with the Solana blockchain and can execute irreversible transactions involving real funds. You are solely responsible for your own transactions, wallet security, and any financial outcomes. The authors are not liable for any losses. This is not financial advice.

Related Content

Sol CLI Guide: Every Solana Command for AI Agents and Humans

The complete guide to Sol CLI — trade, stake, lend, and manage portfolios on Solana from OpenClaw, Claude Code, or any AI agent. No API keys, no code required.

Solana Stake Pools Guide: How They Work, Fees + The Best Pools

Learn how stake pools on Solana can help keep your staking rewards consistent while securing the Solana network

The Rise Of AI Agents | Jeffy Yu & Yash Agarwal

Dive into the world of AI agents on Solana with Jeffy Yu and Yash Agarwal. Discover the potential of decentralized AI, DeFi agents, and Solana's competitive advantages in this emerging space.

The Libra Impact On Solana | Weekly Roundup

Explore the controversial Libra token launch, its impact on Solana, and the broader implications for meme coins and crypto market integrity.

MEV on Solana with buffalu from Jito Labs

Dive deep into the world of MEV on Solana with Lucas from Jito Labs. Learn about validator clients, searchers, and the future of blockchain technology.

Why Solana Should Change Its Inflation Rate | Weekly Roundup

Explore the controversial SIMD 228 proposal to adjust Solana's inflation rate, its potential impact on validators, and the future of blockchain economics.

What Solana Unlocks for GameFi's Backend w/ Albert Chen (Genopets)

Discover how Genopets leverages Solana's unique features to create a seamless Web3 gaming experience, bridging the gap between traditional mobile games and blockchain technology.

Ship or Die 2025: Enterprise Adoption of Stablecoins

Exploring the future of stablecoins and their impact on global financial systems

Breakpoint 2023: DRiP on Solana

A discussion on the evolution and success of DRiP, a Web3 platform on Solana, and its impact on crypto engagement and creator monetization.

Size Matters: How Meteora Will Multiply Solana's TVL | Ben Chow

Ben Chow reveals Meteora's strategy to boost Solana's TVL, introduces the Dynamic Liquidity Market Maker, and shares insights on sustainable DeFi yields and protocol monetization.

Solana's Ultimate Vision | Anatoly Yakovenko

Solana co-founder Anatoly Yakovenko discusses Solana's unique design, scalability advantages, and vision for decentralized global markets in this in-depth podcast interview.

Solana Ecosystem Call ft. Dialect, Hivemapper, DAA, and Google (June 23)

Discover the latest Solana ecosystem developments, including Google's Web3 startup program, 6.6 million new wallets, and exciting innovations from Dialect, DAA, and more.

Solana Changelog May 2 - Account Interfaces, Web3.js Experimental, and Tea Package Manager

Explore the latest Solana changes including account interfaces, Web3.js experimental updates, and the new Tea package manager for easier Solana installation.

SOL Staking on Autopilot with Marinade

Discover how Marinade Finance is transforming Solana staking through liquid staking tokens, decentralized validator selection, and new features like Marinade Native and directed stake.

A Solana Data Deep Dive With Carlos Gonzalez Campo

Explore the latest Solana developments including SIMD 96 impacts, staking dynamics, DeFi shifts, and the growing stablecoin presence on the network.