> ## Documentation Index
> Fetch the complete documentation index at: https://solana.com/llms.txt
> Use this file to discover all available pages before exploring further.

> ## Agent Instructions
> This page is part of the Solana developer documentation at https://solana.com/developers/docs. Append `.md` to any docs URL, or send `Accept: text/markdown`, to get the page as Markdown.
> Index of all pages: https://solana.com/llms.txt. Per-section indexes such as https://solana.com/developers/docs/payments/llms.txt are smaller; prefer them when working on one task.
> Coding agents: install the official Solana skill for current APIs and conventions with `npx skills add https://github.com/solana-foundation/solana-dev-skill` (also served at https://solana.com/SKILL.md).
> Code in the cookbook and task pages comes from tested example files. Prefer it over writing API calls from memory.

# Solana CLI Basics

> This section walks through some common Solana CLI commands to get you started.

This section provides common commands and examples to help you get started with
the Solana CLI.

## Solana config

Your Solana config specifies the following variables:

- **Config file**: The path to your config file
- **RPC URL & Websocket URL**: The Solana cluster to which the CLI makes
  requests
- **Keypair path**: The path to the default Solana wallet (keypair) used to pay
  transaction fees and deploy programs. By default, this file is stored at
  `~/.config/solana/id.json`.

To see your current configuration settings, run:

```bash Terminal
solana config get
```

A successful command will return output similar to the following:

```txt title="Example output"
Config File: /Users/test/.config/solana/cli/config.yml
RPC URL: https://api.mainnet-beta.solana.com
WebSocket URL: wss://api.mainnet-beta.solana.com/ (computed)
Keypair Path: /Users/test/.config/solana/id.json
Commitment: confirmed
```

You can change the Solana CLI cluster with the following commands:

<Tabs>

<Tab title="Full commands">

```bash Terminal
solana config set --url mainnet-beta
solana config set --url devnet
solana config set --url localhost
solana config set --url testnet
```

</Tab>
<Tab title="Short commands">

```bash Terminal
solana config set -um    # For mainnet
solana config set -ud    # For devnet
solana config set -ul    # For localhost
solana config set -ut    # For testnet
```

</Tab>
</Tabs>

## Create a wallet

Before you can send transactions using the Solana CLI, you need a Solana wallet
funded with SOL.

To generate a keypair at the default keypair path, run the following command:

```bash Terminal
solana-keygen new
```

A successful command will return output similar to the following:

```txt title="Example output"
Generating a new keypair

For added security, enter a BIP39 passphrase

NOTE! This passphrase improves security of the recovery seed phrase NOT the
keypair file itself, which is stored as insecure plain text

BIP39 Passphrase (empty for none):

Wrote new keypair to /Users/test/.config/solana/id.json
===========================================================================
pubkey: 8dBTPrjnkXyuQK3KDt9wrZBfizEZijmmUQXVHpFbVwGT
===========================================================================
Save this seed phrase and your BIP39 passphrase to recover your new keypair:
cream bleak tortoise ocean nasty game gift forget fancy salon mimic amazing
===========================================================================
```

<Info>
  This command will not override an existing account at the default location,
  unless you use the `--force` flag.
</Info>

To view your wallet's address (public key), run:

```bash Terminal
solana address
```

## Airdrop SOL

Your wallet needs SOL to pay for transactions and program deployments. On
devnet, get free test SOL from the Solana Faucet.

1. Set your cluster to devnet:

```bash Terminal
solana config set -ud
```

2. Print your wallet address, paste it into the
   [Solana Faucet](https://faucet.solana.com), and request devnet SOL:

```bash Terminal
solana address
```

<Note>

The devnet RPC faucet is closed, so `solana airdrop` on devnet fails with
`airdrop request failed. This can happen when the rate limit is reached.`
`solana airdrop 2` still works against a local validator
(`solana config set -ul`). See
[Airdrops and faucets](/developers/cookbook/development/airdrops-and-faucets)
for other ways to get test SOL.

</Note>

To check your wallet's SOL balance, run the following command:

```bash Terminal
solana balance
```
