Solana CLI Reference

The solana command-line interface configures a cluster connection, reads network state, sends SOL, manages durable nonces, deploys programs, and operates stake and vote accounts.

This reference follows Agave v4.2.1. Run solana --version to check the installed release and use --help for the exact options available in that version.

Commands that create, transfer, authorize, withdraw, or deploy submit transactions. Confirm the configured cluster and signer before running them. Devnet and Testnet tokens have no value; Mainnet commands use real SOL.

Command structure

solana [GLOBAL_OPTIONS] <COMMAND> [COMMAND_OPTIONS]

Get help at any level:

solana --help
solana transfer --help
solana address-lookup-table extend --help

Global options

Global options can be placed before the command. Command-specific help repeats the options that apply to that command.

OptionPurpose
-u, --url <URL_OR_MONIKER>Select an RPC URL or mainnet-beta, testnet, devnet, or localhost.
--ws <URL>Override the WebSocket endpoint.
-k, --keypair <KEYPAIR>Select a keypair file, ASK, stdin (-), or a supported signer URL.
-C, --config <FILEPATH>Use a different CLI configuration file.
--commitment <LEVEL>Read at processed, confirmed, or finalized commitment.
--output <FORMAT>Return json or json-compact where supported.
--skip-preflightSend without RPC simulation. Use only when the failure tradeoff is understood.
--use-tpu-clientSend transactions through the TPU client.
--no-address-labelsPrint addresses without local labels.
--skip-seed-phrase-validationPermit a recovery phrase outside the BIP39 English list.
-v, --verboseShow additional command output.
-V, --versionPrint the installed CLI version.

Configure the CLI

# Inspect the effective configuration.
solana config get
# Use Devnet and a specific signer by default.
solana config set --url devnet
solana config set --keypair ./devnet-keypair.json
# Override defaults for one command.
solana --url mainnet-beta --keypair usb://ledger address

The configuration contains an RPC URL, WebSocket URL, default signer, and commitment. A command-line option overrides the saved value for that invocation.

Common account and transaction workflows

# Print the default signer's address and balance.
solana address
solana balance
# Read an account as JSON.
solana account <ACCOUNT_ADDRESS> --output json
# Request Devnet SOL.
solana airdrop 1 --url devnet
# Send SOL and then confirm the returned signature.
solana transfer <RECIPIENT_ADDRESS> 0.1 --allow-unfunded-recipient
solana confirm <TRANSACTION_SIGNATURE>
# Inspect recent activity and stream logs mentioning an address.
solana transaction-history <ADDRESS> --limit 20
solana logs <ADDRESS>

transfer accepts SOL by default. Use ALL as the amount to move the available balance after fees. For token examples, see the token quickstart.

Program workflows

# Deploy or upgrade an SBF program.
solana program deploy ./target/deploy/my_program.so
# Inspect the deployed program and list programs controlled by the signer.
solana program show <PROGRAM_ID>
solana program show --programs
# Close a program buffer and recover its lamports.
solana program close <BUFFER_ADDRESS>

Pass --program-id <KEYPAIR_OR_ADDRESS> when a deployment must use a known program ID. --final makes a new deployment immutable; read its help carefully before using it because the upgrade authority cannot be restored.

Durable nonce workflows

solana-keygen new --outfile nonce-account.json
solana create-nonce-account nonce-account.json 0.1
solana nonce nonce-account.json
solana new-nonce nonce-account.json
solana withdraw-from-nonce-account nonce-account.json <RECIPIENT_ADDRESS> ALL

Use authorize-nonce-account to change the nonce authority and nonce-account to inspect the full account state. Transactions using a nonce also accept --nonce and --nonce-authority on supported commands.

Stake workflows

solana-keygen new --outfile stake-account.json
solana create-stake-account stake-account.json 1
solana delegate-stake stake-account.json <VOTE_ACCOUNT_ADDRESS>
solana stake-account stake-account.json
solana deactivate-stake stake-account.json
solana withdraw-stake stake-account.json <RECIPIENT_ADDRESS> ALL

Deactivation completes at an epoch boundary and may take more than one epoch. Use stakes, validators, stake-history, and stake-minimum-delegation to inspect cluster and delegation state before submitting changes.

Address utilities

# Derive a PDA from typed seeds.
solana find-program-derived-address \
<PROGRAM_ID> \
string:profile \
pubkey:<OWNER_ADDRESS>
# Create and extend an address lookup table.
solana address-lookup-table create
solana address-lookup-table extend \
<LOOKUP_TABLE_ADDRESS> \
--addresses <ADDRESS_1>,<ADDRESS_2>

PDA seeds use PREFIX:VALUE. Supported prefixes include string, pubkey, hex, u8, and fixed-width signed or unsigned integer encodings such as u64le.

Off-chain messages and shell completion

solana sign-offchain-message "terms accepted"
solana verify-offchain-signature \
"terms accepted" \
<SIGNATURE> \
--signer <SIGNER_ADDRESS>
# Print a completion script for the current shell.
solana completion --shell zsh

Complete command index

The following index includes every top-level command in Agave v4.2.1. Commands such as program, config, feature, and address-lookup-table contain nested commands; run <command> --help to list them.

CommandDescription
accountShow an account's lamports, owner, data, and executable state.
addressPrint the selected signer's public key.
address-lookup-tableCreate, extend, freeze, deactivate, close, and inspect address lookup tables.
airdropRequest SOL from a cluster faucet.
alpenglow-genesis-infoRead information about the Alpenglow genesis certificate.
authorize-nonce-accountAssign a durable nonce account authority.
balanceShow an account's SOL balance.
blockFetch a confirmed block by slot.
block-heightShow the current block height.
block-productionShow leader block production for a slot range.
block-timeEstimate the production time of a block.
catchupWait for a validator to catch up with the cluster.
close-vote-accountClose a vote account and withdraw its remaining funds.
cluster-dateEstimate the cluster date from genesis time and network time.
cluster-versionShow the cluster entrypoint's software version.
completionGenerate a shell completion script.
configGet or set CLI defaults.
confirmCheck a transaction signature's confirmation status.
create-address-with-seedDerive a system address from a base, seed, and program ID.
create-nonce-accountCreate and initialize a durable nonce account.
create-stake-accountCreate a stake account.
create-stake-account-checkedCreate a stake account while checking the withdraw authority as a signer.
create-vote-accountCreate a validator vote account.
deactivate-stakeBegin deactivating delegated stake.
decode-transactionDecode a serialized transaction.
delegate-stakeDelegate a stake account to a vote account.
epochShow the current epoch number.
epoch-infoShow epoch, slot, block height, and transaction count information.
featureInspect and manage runtime feature accounts.
find-program-derived-addressDerive a PDA and canonical bump from typed seeds.
first-available-blockShow the first complete block retained by the RPC node.
genesis-hashShow the cluster genesis hash.
gossipList nodes visible through gossip.
helpPrint root or command help.
inflationShow inflation governor, rate, or reward information.
largest-accountsList the cluster's largest accounts.
leader-scheduleDisplay the leader schedule.
live-slotsStream current slot progression.
logsStream transaction logs, optionally filtered by address.
merge-stakeMerge compatible stake accounts.
new-nonceAdvance a durable nonce.
noncePrint a durable nonce value.
nonce-accountShow complete durable nonce account state.
programDeploy, upgrade, inspect, dump, set authority for, or close programs and buffers.
recent-prioritization-feesShow recent prioritization fees for writable accounts.
rentCalculate the rent-exempt minimum for an account data size.
resolve-signerResolve a general signer reference such as a Ledger URL to its specific path.
sign-offchain-messageSign a UTF-8 off-chain message.
slotShow the current slot.
split-stakeSplit lamports from one stake account into another.
stake-accountShow a stake account's authorities, balance, and delegation state.
stake-authorizeChange a stake or withdraw authority.
stake-authorize-checkedChange a stake authority while checking the new authority as a signer.
stake-historyShow cluster stake activation and deactivation history.
stake-minimum-delegationShow the cluster's minimum stake delegation.
stake-set-lockupSet a stake account lockup.
stake-set-lockup-checkedSet a lockup while checking the new custodian as a signer.
stakesList stake accounts, optionally filtered by validator or authority.
supplyShow circulating, non-circulating, and total SOL supply.
transaction-countShow the cluster transaction count.
transaction-historyList transactions involving an address from newest to oldest.
transferTransfer SOL between system accounts.
upgrade-nonce-accountIdempotently upgrade a legacy nonce account.
validator-infoPublish or read validator information.
validatorsShow validator stake, commission, skip rate, and version summary.
verify-offchain-signatureVerify a signed off-chain message.
vote-accountShow a vote account's authorities, commission, credits, and votes.
vote-authorize-voterChange a vote account's voter authority.
vote-authorize-voter-checkedChange voter authority while checking the new authority as a signer.
vote-authorize-withdrawerChange a vote account's withdraw authority.
vote-authorize-withdrawer-checkedChange withdraw authority while checking the new authority as a signer.
vote-update-commissionChange a vote account's commission.
vote-update-validatorChange the validator identity assigned to a vote account.
withdraw-from-nonce-accountWithdraw some or all SOL from a durable nonce account.
withdraw-from-vote-accountWithdraw lamports from a vote account.
withdraw-stakeWithdraw inactive SOL from a stake account.

Script output

Use --output json or --output json-compact where supported instead of parsing human-readable output:

solana epoch-info --output json
solana account <ACCOUNT_ADDRESS> --output json-compact
solana validators --output json > validators.json

Not every command supports structured output. Check the command's help before depending on it in automation, and treat nonzero exit status as failure.

Is this page helpful?

Table of Contents

Edit Page
© 2026 Solana Foundation. All rights reserved.