5/5
# Mastering the Solana Token CLI: A Step-by-Step Guide to Minting SPL Tokens The Solana Program Library (SPL) Token CLI is an essential tool for developers working within the Solana ecosystem. While graphical user interfaces exist for token creation, mastering the Command Line Interface (CLI) provides a deeper understanding of how Solana accounts, mint authorities, and token standards function. This guide provides a comprehensive walkthrough on installing the Solana Token CLI, setting up a risk-free local environment, and minting your first SPL token. ## 1. Resources & Installation Before interacting with the blockchain, you must install the necessary tooling. We will utilize Cargo, the Rust package manager, to install the SPL Token CLI. **Prerequisites:** Ensure you have Rust and Cargo installed on your machine. To install the CLI tool, run the following command in your terminal: ```bash cargo install spl-token-cli ``` Once the installation is complete, verify that the tool is accessible and check the installed version to ensure compatibility: ```bash spl-token --version # Expected Output Example: spl-token-cli 5.4.0 ``` For further details, you can always reference the [official Solana documentation](https://www.solana-program.com/docs/token). ## 2. Setting Up Your Local Solana Environment To avoid spending real SOL (and real money) on transaction fees during testing, it is best practice to develop on a local cluster. This simulates the Solana blockchain directly on your computer. ### Step A: Configure the CLI First, configure your Solana CLI to communicate with your localhost: ```bash solana config set -ul ``` ### Step B: Start the Test Validator Next, launch the local blockchain. **Important:** This command will run a continuous process. You must leave this terminal window open and **open a new terminal window** to execute subsequent commands. ```bash solana-test-validator ``` ### Step C: Fund Your Wallet Even on a local testnet, transactions require "gas" (transaction fees) and rent exemption deposits. You can simulate this by airdropping fake SOL to your wallet: ```bash solana airdrop 1 ``` ## 3. Understanding Wallet Authority Before creating a token, it is vital to understand the concept of **Mint Authority**. The wallet address used to create the token becomes the Mint Authority by default. This grants the wallet the exclusive permission to increase the supply of that specific token. Furthermore, this wallet address is used to deterministically derive the account needed to hold the tokens later (the Associated Token Account). You can identify your current wallet address with the following command: ```bash spl-token address ``` ## 4. Creating the Token Mint The first major step is creating the "Mint." In Solana architecture, creating a token mint does not immediately put tokens in your wallet; rather, it establishes the *existence* and *rules* (such as decimal precision) of the token on the blockchain. Run the creation command: ```bash spl-token create-token ``` **Understanding the Output:** * **Token Address:** A unique identifier string (e.g., `8gwJd...`). * **Decimals:** Defaults to 9, which is the standard for Solana tokens. **Workflow Tip:** To make future commands easier to execute, save the Token Address generated in the output as an environment variable: ```bash TOKEN_ADDR=<PASTE_YOUR_TOKEN_ADDRESS_HERE> ``` You can now inspect the on-chain metadata of your new token. You will notice the **Total Supply is 0** and the **Mint Authority** matches your wallet address: ```bash spl-token display $TOKEN_ADDR ``` ## 5. Creating a Token Account (ATA) A common point of confusion for new Solana developers is account structure. Your main system wallet cannot hold SPL tokens directly; it can only hold SOL. To hold a specific SPL token, you must create a dedicated **Token Account**. The standard method is creating an **Associated Token Account (ATA)**. This address is mathematically derived from your wallet address and the token's mint address, making it easy for apps to find where your tokens are stored. Create the account using your variable: ```bash spl-token create-account $TOKEN_ADDR ``` **Workflow Tip:** Similar to the previous step, save the resulting Account Address as a variable for verification purposes: ```bash ATA=<PASTE_YOUR_NEW_ACCOUNT_ADDRESS_HERE> ``` ## 6. Minting Tokens Now that you have defined the token (The Mint) and created a place to store it (The ATA), you can mint the actual supply. Use the mint command to create 100 tokens: ```bash spl-token mint $TOKEN_ADDR 100 ``` **Note on Recipients:** You will notice we did not specify a recipient address. When no recipient is defined, the CLI defaults to sending the minted tokens to the **Associated Token Account (ATA)** of the current authority's wallet. If you check the output, the "Recipient" field will match the `ATA` variable you saved earlier. ## 7. Verifying Balances To conclude the process, you should verify that the minting was successful and the balances reflect your actions. There are two primary ways to check this. **Method 1: Check a specific token balance** If you only want to see the balance of the specific token you just created: ```bash spl-token balance $TOKEN_ADDR # Output: 100 ``` **Method 2: List all token accounts** To see a comprehensive portfolio of every token held by your wallet, use the accounts command. This displays the Token Mint Address alongside the current balance: ```bash spl-token accounts ``` **Output Example:** ```text Token Balance 8gwJdggXfSq7mtYJzYwGfpXsF6D8y5etFghtLxoWCiw 100 ``` By following these steps, you have successfully set up a local development environment, navigated the relationship between Wallets, Mints, and ATAs, and minted your own SPL token on Solana.
The Solana Program Library (SPL) Token CLI is an essential tool for developers working within the Solana ecosystem. While graphical user interfaces exist for token creation, mastering the Command Line Interface (CLI) provides a deeper understanding of how Solana accounts, mint authorities, and token standards function.
This guide provides a comprehensive walkthrough on installing the Solana Token CLI, setting up a risk-free local environment, and minting your first SPL token.
Before interacting with the blockchain, you must install the necessary tooling. We will utilize Cargo, the Rust package manager, to install the SPL Token CLI.
Prerequisites: Ensure you have Rust and Cargo installed on your machine.
To install the CLI tool, run the following command in your terminal:
Once the installation is complete, verify that the tool is accessible and check the installed version to ensure compatibility:
For further details, you can always reference the official Solana documentation.
To avoid spending real SOL (and real money) on transaction fees during testing, it is best practice to develop on a local cluster. This simulates the Solana blockchain directly on your computer.
First, configure your Solana CLI to communicate with your localhost:
Next, launch the local blockchain.
Important: This command will run a continuous process. You must leave this terminal window open and open a new terminal window to execute subsequent commands.
Even on a local testnet, transactions require "gas" (transaction fees) and rent exemption deposits. You can simulate this by airdropping fake SOL to your wallet:
Before creating a token, it is vital to understand the concept of Mint Authority. The wallet address used to create the token becomes the Mint Authority by default. This grants the wallet the exclusive permission to increase the supply of that specific token.
Furthermore, this wallet address is used to deterministically derive the account needed to hold the tokens later (the Associated Token Account).
You can identify your current wallet address with the following command:
The first major step is creating the "Mint." In Solana architecture, creating a token mint does not immediately put tokens in your wallet; rather, it establishes the existence and rules (such as decimal precision) of the token on the blockchain.
Run the creation command:
Understanding the Output:
Token Address: A unique identifier string (e.g., 8gwJd...).
Decimals: Defaults to 9, which is the standard for Solana tokens.
Workflow Tip: To make future commands easier to execute, save the Token Address generated in the output as an environment variable:
You can now inspect the on-chain metadata of your new token. You will notice the Total Supply is 0 and the Mint Authority matches your wallet address:
A common point of confusion for new Solana developers is account structure. Your main system wallet cannot hold SPL tokens directly; it can only hold SOL. To hold a specific SPL token, you must create a dedicated Token Account.
The standard method is creating an Associated Token Account (ATA). This address is mathematically derived from your wallet address and the token's mint address, making it easy for apps to find where your tokens are stored.
Create the account using your variable:
Workflow Tip: Similar to the previous step, save the resulting Account Address as a variable for verification purposes:
Now that you have defined the token (The Mint) and created a place to store it (The ATA), you can mint the actual supply.
Use the mint command to create 100 tokens:
Note on Recipients: You will notice we did not specify a recipient address. When no recipient is defined, the CLI defaults to sending the minted tokens to the Associated Token Account (ATA) of the current authority's wallet. If you check the output, the "Recipient" field will match the ATA variable you saved earlier.
To conclude the process, you should verify that the minting was successful and the balances reflect your actions. There are two primary ways to check this.
Method 1: Check a specific token balance
If you only want to see the balance of the specific token you just created:
Method 2: List all token accounts
To see a comprehensive portfolio of every token held by your wallet, use the accounts command. This displays the Token Mint Address alongside the current balance:
Output Example:
By following these steps, you have successfully set up a local development environment, navigated the relationship between Wallets, Mints, and ATAs, and minted your own SPL token on Solana.
A comprehensive guide to Mastering the Solana Token CLI - Setup a local development environment to execute the full token creation lifecycle using the spl-token-cli. Gain command-line proficiency in managing Mint Authorities, generating Associated Token Accounts, and validating on-chain balances.
Previous lesson
Previous
Next lesson
Next
Course Overview
About the course
Native Rust & Anchor framework
PDAs, CPIs, and SPL Tokens
DeFi builds: oracles, auctions, AMMs
Last updated on January 12, 2026
Rust Developer
SolanaDuration: 8min
Duration: 23min
Duration: 4min
Duration: 2min
Duration: 4min
Duration: 11min
Duration: 4min
Duration: 0min
Duration: 0min
Course Overview
About the course
Native Rust & Anchor framework
PDAs, CPIs, and SPL Tokens
DeFi builds: oracles, auctions, AMMs
Last updated on January 12, 2026