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

# Phantom CLI

> Use the Phantom CLI to sign transactions, swap tokens, and manage your Phantom wallet from the terminal on Solana, supported EVM networks, and Hyperliquid.

The Phantom CLI (`@phantom/cli`) lets you interact with your Phantom embedded wallet directly from the terminal. It supports:

* **Wallet management** — check balances, get addresses, and rebalance portfolios
* **Solana and supported EVM networks** — sign messages, send transactions, swap tokens across chains
* **Hyperliquid perpetuals** — open positions, manage orders, deposit and withdraw
* **MCP server mode** — run as an AI agent tool server exposing all wallet operations as MCP tools

> [!WARNING]
>
> **BNB Smart Chain (BSC, `eip155:56`; chain ID `56`) is not supported by the released CLI/MCP transaction tools.** Use a [supported network](https://docs.phantom.com/phantom-mcp-server/tools.md#supported-networks) before funding a wallet. Receiving assets or viewing a balance on a network does not establish transaction support.

> [card] [Installation](https://docs.phantom.com/phantom-cli/installation.md)
>
> Install the CLI, authenticate, and run your first command.

> [card] [Commands](https://docs.phantom.com/phantom-cli/commands.md)
>
> Full reference for all CLI commands and flags.

## How it works

The CLI authenticates via **Phantom Connect** — a browser-based OAuth flow (Google, Apple, or Phantom extension). Sessions persist locally and refresh automatically, so you only sign in once.

```bash theme={null}
# Install globally
npm install -g @phantom/cli

# Authenticate
phantom login

# Check your balances
phantom wallet balances
```

## MCP server mode

Run the CLI as an [MCP stdio server](https://modelcontextprotocol.io) to expose all wallet operations as tools for AI agents (Claude, Cursor, and others):

```bash theme={null}
phantom --mcp
```

See the [Phantom MCP Server](https://docs.phantom.com/phantom-mcp-server/index.md) docs for the full tool reference and agent setup instructions.
