Skip to main content

CLI Overview

The Packet CLI (xpkt) lets you interact with the Packet Protocol directly from your terminal — send encrypted messages, manage inboxes, upload content to Irys, and subscribe to live message events.

Installation

npm install -g xpkt-cli

Or run it directly with npx:

npx xpkt-cli --help

Quick Start

1. Configure your wallet and RPC:

# Import a private key (CLI manages it)
packet init config --rpc https://your-rpc-url --private-key <base58-key>

# Or point to an existing Solana CLI keypair
packet init config --rpc https://your-rpc-url --keypair ~/.config/solana/id.json

2. Create an inbox:

packet message create-inbox --inbox 0

3. Send a message:

packet message new-thread --to <recipient-pubkey> --content "Hello!"

4. Read your inbox:

packet message inbox 0

Command Groups

GroupDescription
init configConfigure RPC endpoint and wallet
messageSend, read, and manage messages, inboxes, and escrow
cryptoStandalone encrypt/decrypt operations
uploadUpload raw content or files to Irys

Global Behavior

Config File

The CLI stores its configuration in a TOML file at the platform default config directory:

PlatformPath
Linux~/.config/xpkt/config.toml
macOS~/Library/Preferences/xpkt/config.toml
Windows%APPDATA%\xpkt\Config\config.toml

Wallet Storage

When you import a private key with --private-key, it is stored as a Solana-format JSON keypair at <config-dir>/wallet.json with mode 0600 (owner read-only). When you use --keypair, the CLI only records the path — the key never moves.

Runtime Overrides

Most commands inherit RPC and keypair from config. You can override per-invocation with environment variables (check --help on each command for current flags).


Next Steps

  • Configuration — full reference for init config
  • Messages — send and read messages, browse inboxes
  • Crypto — standalone encrypt and decrypt
  • Upload — upload files and raw content to Irys