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.
Use Solana Playground to run the commands in your
browser, or install the CLI locally with cargo install spl-token-cli. The
addresses in your output will differ from the examples below.
1. Connect to devnet
Create or connect a wallet in Solana Playground, then select devnet and request SOL for account deposits and transaction fees:
$solana config set --url devnet$solana airdrop 2
Use devnet tokens only for testing. They have no financial value.
2. Create a token
Create the mint account that identifies your token:
$spl-token create-token
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.
$spl-token supply <MINT_ADDRESS>
3. Create a token account
Your wallet needs a token account for this mint before it can hold a balance:
$spl-token create-account <MINT_ADDRESS>
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:
$spl-token mint <MINT_ADDRESS> 100$spl-token balance <MINT_ADDRESS>
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:
$spl-token transfer <MINT_ADDRESS> 10 <RECIPIENT_WALLET_ADDRESS> --fund-recipient
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:
$spl-token create-token \--program-id TokenzQdBNbLqP5VEhdkAS6EPFLC1PHnBqCXEpPxuEb \--enable-metadata
Then use the new mint address printed by that command:
$spl-token initialize-metadata \<MINT_ADDRESS> \"Example Token" \"EXAMPLE" \"https://example.com/token.json"
The URI should return a public JSON metadata document. See Token-2022 metadata for the account model and code examples.
Where to go next
- Token basics - perform the same operations in TypeScript or Rust
- Token extensions - add transfer fees, metadata, pausing, and other Token-2022 features
- Asset issuance and tokenization - design and operate production tokenized assets
Is this page helpful?