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

@xmtp/cli

v0.2.0

Published

A command-line interface for XMTP

Downloads

2,725

Readme

@xmtp/cli

[!CAUTION] This CLI is in beta status and ready for you to use. Software in this status may contain bugs or change based on feedback.

A command-line interface for XMTP, the decentralized messaging protocol.

Features

  • Send and receive encrypted messages
  • Manage direct messages (DMs) and group conversations
  • Manage identity across multiple wallets
  • Set consent preferences for spam control
  • Stream messages and conversations in real-time
  • JSON output for scripting and automation

Requirements

  • Node.js >= 22

Installation

# npm
npm install -g @xmtp/cli

# pnpm
pnpm add -g @xmtp/cli

Run Without Installing

# npx
npx @xmtp/cli --help

# pnpx
pnpx @xmtp/cli --help

# yarn
yarn dlx @xmtp/cli --help

Quick Start

# 1. Generate wallet and encryption keys
xmtp init

# 2. Check if a recipient can receive messages
xmtp can-message <address>

# 3. Create a DM and send a message
xmtp conversations create-dm <address>
xmtp conversation send-text <conversation-id> "Hello!"

# 4. Create a group and send a message
xmtp conversations create-group <address-1> <address-2> --name "My Group"
xmtp conversation send-text <conversation-id> "Hello!"

Configuration

Running xmtp init generates a .env file at ~/.xmtp/.env with:

| Variable | Description | | ------------------------ | ---------------------------------------- | | XMTP_WALLET_KEY | Ethereum private key (hex) | | XMTP_DB_ENCRYPTION_KEY | 32-byte database encryption key (hex) | | XMTP_ENV | Network: local, dev, or production |

The default environment is dev. Use --env to change it:

xmtp init --env production

Values from the .env file can always be overridden with CLI flags:

xmtp client info --env production --wallet-key <key> --db-encryption-key <key> --db-path ./my-db

Configuration is loaded in priority order:

  1. CLI flags (highest)
  2. --env-file <path>
  3. .env in current directory
  4. ~/.xmtp/.env (default)

Command Topics

| Topic | Purpose | | --------------- | -------------------------------------- | | client | Identity and installation management | | conversations | List, create, and stream conversations | | conversation | Interact with a single conversation | | preferences | Consent and preference management |

Run xmtp --help for all commands, or xmtp <command> --help for details on a specific command.

Usage Examples

Messages

# Send different message types
xmtp conversation send-text <conversation-id> "Hello!"
xmtp conversation send-markdown <conversation-id> "**bold** text"
xmtp conversation send-reply <conversation-id> <message-id> "Reply"
xmtp conversation send-reaction <conversation-id> <message-id> add "👍"

# Read messages
xmtp conversation messages <conversation-id>
xmtp conversation messages <conversation-id> --sync --limit 10

Streaming

# Stream messages from all conversations
xmtp conversations stream-all-messages

# Stream from a single conversation
xmtp conversation stream <conversation-id>

# Stream new conversations
xmtp conversations stream --type dm

Groups

# Create with metadata and permissions
xmtp conversations create-group <address> \
  --name "Project Team" \
  --description "Team discussion" \
  --permissions admin-only

# Manage members
xmtp conversation members <conversation-id>
xmtp conversation add-members <conversation-id> <address>
xmtp conversation remove-members <conversation-id> <address>

Identity

# View client info
xmtp client info

# Sign and verify messages
xmtp client sign "Hello, World!"
xmtp client verify-signature "Hello, World!" --signature <signature>

# Manage wallets
xmtp client add-account --new-wallet-key <wallet-key> --force
xmtp client remove-account --identifier <address> --force

JSON Output

All commands support --json for machine-readable output:

DM_ID=$(xmtp conversations create-dm <address> --json | jq -r '.id')
xmtp conversation send-text "$DM_ID" "Hello!"

Verbose Output

Use --verbose to see detailed client initialization info. When combined with --json, verbose logs go to stderr:

xmtp client info --verbose

AI Coding Agent Skill

This package includes an agent skill (skills/xmtp-cli/SKILL.md) that teaches AI coding agents how to use the XMTP CLI.

Claude Code

Add the skill directory to your project's .claude/settings.json:

{
  "skills": ["./node_modules/@xmtp/cli/skills"]
}

Other agents (Cursor, Windsurf, Codex, etc.)

Use openskills to install the skill:

npx openskills install ./node_modules/@xmtp/cli/skills

Or point your agent to node_modules/@xmtp/cli/skills/xmtp-cli/SKILL.md directly.