Quickstart: create a token with the CLI

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:

Terminal
$
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:

Terminal
$
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.

Terminal
$
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:

Terminal
$
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:

Terminal
$
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:

Terminal
$
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:

Terminal
$
spl-token create-token \
--program-id TokenzQdBNbLqP5VEhdkAS6EPFLC1PHnBqCXEpPxuEb \
--enable-metadata

Then use the new mint address printed by that command:

Terminal
$
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

Is this page helpful?

İçindekiler

Sayfayı Düzenle
© 2026 Solana Vakfı. Tüm hakları saklıdır.
Quickstart: create a token with the CLI | Solana