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-token | gp-cli | |
|---|---|---|
| Source | Official Solana tooling | Graveyard Protocol (npm) |
| Network path | Directly to your RPC | Signed transactions relayed via the protocol backend |
| Fee | Network fee only | Network fee plus a protocol fee on reclaimed rent |
| Bulk closing | Depends on version; otherwise script it | Built in, with automatic batching |
| Dry run | Not as a single flag | --dry-run |
| Burning small balances first | Separate burn step | Handled in the same flow for burnable accounts |
| Multiple wallets | One keypair per command | Saved wallets with --all |
| Rewards | None | Earns $GHOST points |
| Stats and reports | None | gp stats, CSV export |
| Automation | Shell scripting | --json and --yes flags |
Security considerations
- spl-token uses the keypair file you point it at. Nothing leaves your machine except signed transactions going to the RPC you choose.
- gp-cli stores wallets in
~/.gp-cli/wallets.json, encrypted with AES-256-GCM and PBKDF2 key derivation. It signs locally and never sends your private key to the backend. - With either tool, use a dedicated wallet for automation, keep key files out of git and review a dry run before closing anything.
- Burning is irreversible. Only close or burn accounts you are sure you no longer need. See our safety guide.
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.

