☰
← All posts

spl-token vs gp-cli: Closing Empty Solana Token Accounts from the Command Line

2026-11-08 · 3 min read

CLIspl-tokengp-cli

You can reclaim rent from empty token accounts without a browser. Two command-line options are the official spl-token CLI and Graveyard Protocol's gp-cli. Both return the same rent deposit (about 0.00204 SOL per standard account), but they work very differently.

Closing accounts with spl-token

spl-token ships with the Solana tooling and talks directly to a Solana RPC. The basic flow is:

# list your token accounts and balances
spl-token accounts

# close one empty account; rent returns to your wallet
spl-token close --address <TOKEN_ACCOUNT>

Newer versions can also close the associated account for a mint or all empty associated accounts in one go. Run spl-token close --help to see what your installed version supports. Token-2022 accounts need --program-id pointing at the Token-2022 program, and accounts with withheld transfer fees must have those fees harvested first.

Closing accounts with gp-cli

gp-cli is a Node.js tool (Node 20 or newer) that scans your wallet, builds batched transactions and signs them locally. It sends only the signed transaction to the Graveyard Protocol backend, which submits it to the network.

npm install -g @graveyardprotocol/gp-cli
gp init
gp add-wallet --keypair-file <filePath> --name "Main"

# preview, then close
gp close-empty --wallet <address> --dry-run --yes
gp close-empty --wallet <address> --yes

Use --all to process every saved wallet and --json for machine-readable output in scripts and CI. See the Tools page for the full command list.

Side-by-side comparison

 spl-tokengp-cli
SourceOfficial Solana toolingGraveyard Protocol (npm)
Network pathDirectly to your RPCSigned transactions relayed via the protocol backend
FeeNetwork fee onlyNetwork fee plus a protocol fee on reclaimed rent
Bulk closingDepends on version; otherwise script itBuilt in, with automatic batching
Dry runNot as a single flag--dry-run
Burning small balances firstSeparate burn stepHandled in the same flow for burnable accounts
Multiple walletsOne keypair per commandSaved wallets with --all
RewardsNoneEarns $GHOST points
Stats and reportsNonegp stats, CSV export
AutomationShell scripting--json and --yes flags

Security considerations

Which should you use?

Choose spl-token if you want zero extra fees, no third-party backend and full control, and you are comfortable handling a handful of accounts or writing your own loop.

Choose gp-cli if you manage many wallets or hundreds of accounts, want batching, dry runs and JSON output for automation, or want to earn $GHOST points toward weekly $SOUL claims. The protocol fee pays for that convenience, and you see the numbers in the dry run before signing.

Prefer a browser? The dApp walkthrough does the same job with a wallet extension.

Keep Reading

Ready to Reclaim Your SOL?

Scan your wallet, close empty token accounts and earn $GHOST. Non-custodial, and you approve every transaction.