Sol CLI: A Solana Skill for AI Agents
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.
Comments
Please login to leave a comment.
On this page
- What Sol CLI Does: A Solana Skill for AI Agents
- Quick Start
- Who Uses Sol CLI: OpenClaw Bots, Claude Code Agents, and Humans
- Solana Trading, Staking, and DeFi via CLI
- AI Agent Security: Code-Level Permissions on Solana
- Install Sol CLI: OpenClaw Skill, Claude Code Plugin, or npm
- Sol CLI vs Solana Agent Kit and Other AI Tools
- Structured JSON Output for AI Agents
- Open Source
Related Content
Why Your AI Agent Needs a Permissions System (Before It Gives Away $250,000)
An OpenClaw bot gave away $250K in tokens. Malicious ClawHub skills target crypto wallets. Here's why your Clawdbot, OpenClaw, or Claude Code agent needs code-level permissions, not prompt engineering.
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.
How to Give Your AI Agent Access to Financial Markets on Solana
Your OpenClaw bot or Claude Code agent can buy tokenized stocks, gold, Bitcoin, Ethereum, and hundreds more — plus earn yield on stablecoins. Set up AI-powered investing on Solana.
Polymarket with an AI Agent: Trade Prediction Markets on Solana
Your OpenClaw bot or Claude Code agent can browse, research, and trade Polymarket and Kalshi prediction markets on Solana. Binary YES/NO contracts on crypto, politics, sports, and more — all settled in USDC.
x402 on Solana: Your AI Agent Can Pay for Its Own Data
AI agents can now pay for premium APIs, web scraping, and market data per-request using USDC on Solana. No API keys, no subscriptions — just sol fetch and a wallet.
Charge AI Agents for Your Laravel APIs and Content with x402
Add one line of Laravel middleware to charge AI agents and crawlers per-request in USDC on Solana. Keep content free for humans, monetize AI traffic. No API keys, no billing portal.
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
Staking On Solana: How To Stake Your Sol + Earn APY Rewards
Learn how you can earn rewards on your crypto assets by staking them on the Solana network,
Find The Best Solana Validator
Our guide to choosing a validator to stake with. It's not as simple as you think!
The Best Wallets for Solana for Staking, NFTs, and Defi
To make the most of Solana you'll need a wallet that is secure and supports NFTs, Defi and tokens. Read on to find our favourites
Turbo Staking
Get Bonus APY on your SOL with Turbo Staking via Solana Compass and Marinade
The Top Solana Projects: The Best Apps, Dapps, Defi, & NFTs
Want to learn what you can do with Solana Blockchain? The Solana Ecosystem is filled with a wide range of apps, Dapps, Defi projects, and NFTs. Below we’ve highlighted some of the most popular and best apps, Dapps, Defi, and NFT projects based on th
How Much Do Solana Validators Make?
Curious about how Validators work on Solana?
