Skip to content
This quickstart walks through the complete token lifecycle with the spl-token CLI. You will create a mint, create an account that can hold the token, mint 100 tokens, and transfer some to another wallet. Run the commands in your browser in Solana Playground, or run them locally. The spl-token CLI ships with the Solana CLI, so a local Solana CLI install already includes it. To install spl-token on its own, run cargo install spl-token-cli --locked. The addresses in your output will differ from the examples below. In Playground, the terminal opens inside a project: under Start from scratch, click Start, then press Ctrl+J or click Terminal at the bottom of the editor. Enter one command at a time: in a multi-line paste, Playground runs the first line, then joins each later line onto the lines before it, so those commands fail.

​1. Connect to devnet

Point the CLI at devnet:
Terminal
In Playground, the first command asks Your Playground wallet is not connected. Connect it? [Y/n]. Type y, then click Continue in the Playground Wallet dialog. The Playground wallet pays the fees and signs every command on this page, so skip solana-keygen below: Playground doesn’t have that command. Locally, create a keypair if you don’t have one. The CLI uses ~/.config/solana/id.json as your wallet: it pays the fees and signs every command on this page.
Terminal
Next, get devnet SOL for account deposits and transaction fees. The devnet RPC faucet is closed, so solana airdrop fails on devnet. Instead, print your wallet address:
Terminal
Paste the address into the Solana Faucet, request devnet SOL, then check your balance with solana balance. For other faucets, see Airdrops and faucets. Locally, you can skip the faucet by running the quickstart against a local validator: start solana-test-validator in a second terminal, run solana config set --url localhost, and fund your wallet with solana airdrop 2, which still works there. Use devnet tokens only for testing. They have no financial value.

​2. Create a token

Create the mint account that identifies your token:
Terminal
Copy the token address from the output. This is the mint address you will use in the remaining commands. A new mint starts with a supply of zero.
Terminal

​3. Create a token account

Your wallet needs a token account for this mint before it can hold a balance:
Terminal
This creates your associated token account, whose address is derived from your wallet and the mint.

​4. Mint tokens

Mint 100 tokens into your associated token account:
Terminal
Check your balance:
Terminal
The mint authority must sign this operation. Minting increases both your token account balance and the total supply recorded by the mint.

​5. Transfer tokens

Send 10 tokens to another devnet wallet. The --fund-recipient option creates the recipient’s associated token account if it does not exist. If the recipient wallet holds no SOL, also pass --allow-unfunded-recipient, or the CLI refuses to send:
Terminal
The transfer changes the balances in the sender and recipient token accounts; it does not change the mint’s total supply.

​Optional: add Token-2022 metadata

To store a name, symbol, and URI directly on a new Token-2022 mint, create it with the metadata extension enabled. Run this section with the local spl-token CLI: the version in Solana Playground doesn’t support --enable-metadata or initialize-metadata.
Terminal
Then use the new mint address printed by that command:
Terminal
The URI should return a public JSON metadata document. See Token-2022 metadata for the account model and code examples.

​Where to go next