npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@phantom/cli

v1.2.7

Published

Phantom CLI — interact with your Phantom wallet from the terminal

Downloads

4,371

Readme

@phantom/cli

Phantom CLI — sign transactions, transfer tokens, and swap on Solana and Ethereum. Powered by Phantom.

Installation

npm install -g @phantom/cli

This installs the phantom binary.

Usage

phantom --help

MCP Server mode

Run as an MCP stdio server (for use with AI agents):

phantom --mcp

Or use the dedicated @phantom/mcp-server package which wraps this in a standalone binary.

Register with your agent

phantom mcp add

Commands

Authentication

phantom login   # Authenticate with Phantom. Use this to log in for the first time, switch accounts, or refresh an expired session.
phantom logout  # Clear the stored session and credentials from disk. The next command will require re-authentication.

Wallet

phantom wallet status      # Check connection status (no API call)
phantom wallet addresses   # Get all wallet addresses
phantom wallet balances    # Get token balances
phantom wallet rebalance   # Rebalance portfolio to a target allocation

Solana

phantom solana send   # Send a signed Solana transaction
phantom solana sign   # Sign a Solana message

EVM

phantom evm send         # Send a signed EVM transaction
phantom evm sign         # Sign an EVM personal message
phantom evm sign-typed   # Sign EVM typed data (EIP-712)
phantom evm allowance    # Get ERC-20 token allowance for a spender

Tokens & Swaps

phantom transfer   # Transfer tokens between wallets
phantom buy        # Buy a token with another token (swap)
phantom simulate   # Simulate a transaction before executing
phantom pay        # Pay for API access using tokens
phantom price      # Look up the current price of a token by address and chain

Perpetuals (Hyperliquid)

See PERPS.md for full perpetuals documentation.

phantom perps markets          # List available markets
phantom perps account          # Get account summary
phantom perps positions        # Get open positions
phantom perps orders           # Get open orders
phantom perps history          # Get trade history
phantom perps open             # Open a position
phantom perps close            # Close a position
phantom perps cancel           # Cancel an order
phantom perps leverage         # Update leverage
phantom perps transfer         # Transfer spot → perps
phantom perps deposit          # Bridge tokens into Hyperliquid
phantom perps withdraw         # Bridge USDC from perps to external chain
phantom perps withdraw-hl-spot # Bridge USDC from Hyperliquid spot to external chain

MCP Tools

When running as an MCP server (phantom --mcp), all commands are exposed as MCP tools. Tool names follow the pattern <group>_<command> (e.g. wallet_status, perps_markets). Top-level commands typically use their command name directly (e.g. phantom_login, buy, transfer), though some use a more descriptive MCP name (e.g. get_token_price for phantom price).

| Tool | Description | | -------------------------------- | --------------------------------------------------- | | phantom_login | Authenticate with Phantom | | wallet_status | Check connection status | | wallet_addresses | Get wallet addresses | | wallet_balances | Get token balances | | wallet_rebalance | Rebalance portfolio | | get_token_price | Look up token price by address and chain | | solana_send | Send a Solana transaction | | solana_sign | Sign a Solana message | | evm_send | Send an EVM transaction | | evm_sign | Sign an EVM personal message | | evm_sign-typed | Sign EVM typed data | | evm_allowance | Get ERC-20 allowance | | transfer | Transfer tokens | | buy | Buy/swap tokens | | simulate | Simulate a transaction | | pay | Pay for API access | | perps_markets | List perp markets | | perps_account | Get perps account | | perps_positions | Get open positions | | perps_orders | Get open orders | | perps_history | Get trade history | | perps_open | Open a position | | perps_close | Close a position | | perps_cancel | Cancel an order | | perps_leverage | Update leverage | | perps_transfer | Transfer spot → perps | | perps_deposit | Bridge tokens to Hyperliquid | | perps_withdraw | Bridge USDC from perps to external chain | | withdraw_from_hyperliquid_spot | Bridge USDC from Hyperliquid spot to external chain |

Configuration

| Variable | Description | | ---------------------- | ---------------------------------------------------------------------- | | PHANTOM_API_BASE_URL | Override the Phantom API base URL (default: https://api.phantom.app) |

Authentication

On first use, the CLI will prompt you to authenticate via browser. Sessions are persisted locally and refreshed automatically.

Requirements

  • Node.js 18+