Skip to main content
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 EVM — 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

Installation

Install the CLI, authenticate, and run your first command.

Commands

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.
# 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 to expose all wallet operations as tools for AI agents (Claude, Cursor, and others):
phantom --mcp
See the Phantom MCP Server docs for the full tool reference and agent setup instructions.