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

@aomkoyo/discord-cli

v0.2.2

Published

CLI tool to send messages and files to Discord channels

Readme

@aomkoyo/discord-cli

npm GitHub

Zero-dependency CLI for sending messages and files to Discord channels. Uses Node.js built-in fetch against the Discord REST API v10 directly.

Part of claude-tmux-discord — AI coding agents running in tmux use this to send replies back to Discord.

GitHub | Issues | Wiki

Install

npm install -g @aomkoyo/discord-cli
# or
pnpm add -g @aomkoyo/discord-cli

Usage

# Send a text message
discord-send "Hello from the CLI!"

# Send to a specific channel
discord-send "Hello" -c 1234567890123456789

# Reply to a message
discord-send "Got it!" -r 1234567890123456789

# Attach a local file
discord-send "Here's the file" -f ./report.pdf

# Attach multiple files
discord-send "Screenshots" -f ./before.png -f ./after.png

# Attach from URL
discord-send "Check this out" -f https://example.com/image.png

# Send only files (no text)
discord-send -f ./output.zip

# Use a specific bot token
discord-send "Hello" -t "Bot_TOKEN_HERE" -c 1234567890123456789

Options

discord-send <message> [options]

Options:
  -c, --channel <id>      Target channel ID
  -r, --reply <id>        Message ID to reply to
  -t, --token <token>     Discord bot token
  -f, --file <path|url>   Attach a file (repeat for multiple)
  -h, --help              Show help

Authentication

The token is resolved in this order:

  1. -t flag (highest priority)
  2. DISCORD_TOKEN environment variable
  3. DISCORD_TOKEN in .env file (searches cwd, then parent directories)

Channel ID

The target channel is resolved in this order:

  1. -c flag (highest priority)
  2. DEFAULT_CHANNEL_ID environment variable
  3. DEFAULT_CHANNEL_ID in .env file

Environment Variables

DISCORD_TOKEN=your-bot-token
DEFAULT_CHANNEL_ID=your-default-channel-id

Or create a .env file in your project root with the above variables.

Features

  • Zero runtime dependencies — uses Node.js 22+ built-in fetch
  • Send text messages with optional file attachments
  • Attach local files or remote URLs (fetched and re-uploaded)
  • Reply to specific messages
  • Multiple file attachments in a single message
  • Automatic .env file discovery (cwd and parent directories)
  • Suppresses @mentions by default (allowed_mentions: { parse: [] })

Use with AI Agents

This CLI is designed to be called by AI coding agents (Claude Code, Codex, Gemini, etc.) running inside tmux sessions. The agent's system prompt instructs it to use discord-send for all communication back to the Discord user.

# Agent sends a response
discord-send "I've fixed the bug in auth.ts. The issue was..."

# Agent sends a file it created
discord-send "Here's the generated report" -f ./output/report.pdf

# Agent replies to the user's message
discord-send "Working on it..." -r 1234567890123456789

Requirements

  • Node.js >= 22

Contributing

Contributions are welcome! Please open an issue or PR on GitHub.

License

MIT - see LICENSE