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 🙏

© 2025 – Pkg Stats / Ryan Hefner

@xmtp/cli

v0.0.4

Published

A command-line interface for XMTP.

Downloads

1,393

Readme

XMTP CLI

XMTP CLI is a command-line interface for interacting with the XMTP protocol.

Its goal is to make CLI interaction with XMTP messaging as human-friendly as possible.

XMTP CLI is designed for testing, debugging, and generally interacting with XMTP conversations, groups, and messages.

The xmtp command allows for managing conversations, sending messages, and debugging your XMTP setup.

It uses simple and natural syntax and provides formatted and colorized output.

Getting started

Installation

npm install -g @xmtp/cli
# or
pnpm add -g @xmtp/cli
# or
yarn global add @xmtp/cli

Usage Without Installation

You can also run the CLI without installing it globally:

# npm
npx @xmtp/cli <command> <arguments>

# pnpm
pnpx @xmtp/cli <command> <arguments>

# yarn
yarn dlx @xmtp/cli <command> <arguments>

Features

  • Manage XMTP groups and direct messages

  • Send messages to conversations

  • Debug and diagnose XMTP setup

  • List conversations, members, and messages

  • Manage group permissions

  • Support for various content types (text, markdown, attachments, transactions, and more)

  • Formatted and colorized output

See all features →

Environment Variables

Set the following required variables in your .env file:

XMTP_ENV=dev                    # or production
XMTP_WALLET_KEY=0x1234...      # Private key for Ethereum wallet
XMTP_DB_ENCRYPTION_KEY=0xabcd... # Database encryption key
XMTP_DB_DIRECTORY=my/database/dir # Database directory (optional)

Examples

Send a message to an address:

xmtp send --target 0x1234... --message "Hello!"
# Send a message to a group
xmtp send --group-id <group-id> --message "Welcome!"
# Send and wait for a response
xmtp send --target 0x1234... --wait

Create a group and send a message:

xmtp groups create --type group --name "Team" --member-addresses "0x123...,0x456..."
xmtp send --group-id <group-id> --message "Welcome!"

Get debug information:

xmtp debug info

List conversations:

xmtp list conversations

Use without installation:

npx @xmtp/cli send --target 0x1234... --message "Hello!"

See more examples →

Commands

Groups

Manage XMTP groups and DMs.

# Create a DM
xmtp groups create --target 0x123...

# Create a group with member addresses
xmtp groups create --type group --name "Team" --member-addresses "0x123...,0x456..."

# Create a group with inbox IDs
xmtp groups create --type group --name "Team" --member-inbox-ids "inbox1...,inbox2..."

# Create a group with both addresses and inbox IDs
xmtp groups create --type group --name "Team" --member-addresses "0x123..." --member-inbox-ids "inbox1..."

# Update group metadata
xmtp groups metadata --group-id <id> --name "New Name"

Options:

  • --target <address> - Target address (required for DM)
  • --type <type> - Conversation type: dm or group (default: dm)
  • --name <name> - Group name
  • --member-addresses <addresses> - Comma-separated member Ethereum addresses
  • --member-inbox-ids <inboxIds> - Comma-separated member inbox IDs
  • --group-id <id> - Group ID for metadata operations
  • --image-url <url> - Image URL for metadata updates

Debugging

CLI can also recognize the following environment variables for debugging:

| Variable | Purpose | Example | | ------------------------ | -------------------------------------------------------------------- | ------------------------------ | | XMTP_FORCE_DEBUG | Activate debugging logs | XMTP_FORCE_DEBUG=true | | XMTP_FORCE_DEBUG_LEVEL | Specify the logging level (defaults to "info") | XMTP_FORCE_DEBUG_LEVEL=debug |

Send

Send messages to conversations.

# Send to address
xmtp send --target 0x1234... --message "Hello!"

# Send to address with alias
xmtp send -t 0x1234... -m "Hello!"

# Send to group
xmtp send --group-id abc123... --message "Hello group!"

# Send and wait for response
xmtp send --target 0x1234... --message "Hello!" --wait

# Send and wait for response with custom timeout
xmtp send --target 0x1234... --message "Hello!" --wait --timeout 60000

Options:

  • --target <address> / -t - Target wallet address
  • --group-id <id> - Group ID
  • --message <text> / -m - Message text (default: "hello world")
  • --wait - Wait for a response after sending the message (default: false)
  • --timeout <ms> - Timeout in milliseconds when waiting for response (default: 30000)

Debug

Get debug and diagnostic information.

# General info
xmtp debug info

# Resolve address to inbox ID
xmtp debug resolve --address 0x1234...

# Get address information
xmtp debug address --address 0x1234...

# Get inbox information
xmtp debug inbox --inbox-id abc...

Operations: info (default), address, inbox, resolve, installations, key-package

Options:

  • --address <address> - Ethereum address
  • --inbox-id <id> - Inbox ID

Permissions

Manage group permissions.

# List members and permissions
xmtp permissions list --group-id <id>

# Get detailed group info
xmtp permissions info --group-id <id>

# Update permissions
xmtp permissions update-permissions --group-id <id> --features update-metadata --permissions admin-only

Operations: list (default), info, update-permissions

Options:

  • --group-id <id> - Group ID (required)
  • --features <features> - Comma-separated features to update
  • --permissions <type> - Permission type: everyone, disabled, admin-only, super-admin-only

List

List conversations, members, and messages.

# List conversations
xmtp list conversations

# List members
xmtp list members --conversation-id <id>

# List messages
xmtp list messages --conversation-id <id>

# Find conversation
xmtp list find --address 0x1234...

Operations: conversations (default), members, messages, find

Options:

  • --conversation-id <id> - Conversation ID
  • --limit <count> - Maximum results (default: 50)
  • --offset <count> - Pagination offset (default: 0)
  • --address <address> - Ethereum address for find
  • --inbox-id <id> - Inbox ID for find

Content

Demonstrate various XMTP content types.

# Send text with reply and reaction
xmtp content text --target 0x1234...

# Send markdown
xmtp content markdown --target 0x1234...

# Send attachment
xmtp content attachment --target 0x1234...

Operations: text (default), markdown, attachment, transaction, deeplink, miniapp

Options:

  • --target <address> - Target wallet address
  • --group-id <id> - Group ID
  • --amount <amount> - Amount for transactions (default: 0.1)

Getting Help

xmtp --help
xmtp <command> --help

Community & Support

Contributing

Have a look through existing Issues and Pull Requests that you could help with. If you'd like to request a feature or report a bug, please create a GitHub Issue using one of the templates provided.

See contribution guide →

Development

# Build
yarn build

# Run during development
yarn start

Build something delightful. Then tell us what you wish was easier.

Happy hacking!