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

snag-cli

v0.0.4

Published

Open-source webhook inspector CLI for Snag: create public capture URLs, stream live requests, forward them to localhost, inspect payloads, and replay webhooks.

Readme

snag-cli

snag-cli is the terminal client for Snag. It lets you watch captured requests, inspect a request by ID, replay requests to another target, and authenticate with magic links.

listen is the real-time capture stream. Use replay when you want to forward a captured request to a specific destination.

Install

npm install -g snag-cli

Then run:

snag --help

Requirements

  1. Node.js 20+
  2. A reachable Snag server (local or hosted)

By default the CLI uses the hosted API at https://snag-server.fly.dev. Override with --server <url> or set SNAG_SERVER_URL when running a local or self-hosted server.

Quick start

  1. Start the CLI listener:
snag listen 3000
  1. Send a webhook to the printed public URL (.../h/<token>).
  2. Copy the requestId from output and inspect it:
snag inspect <requestId>
  1. Replay it to another target:
snag replay <requestId> --target https://httpbin.org/post

Commands

snag listen <port>

Listen for real-time captured requests for a token.

Options:

  • -t, --token <token> reuse a specific endpoint token
  • -s, --server <url> server base URL
  • --method <method> filter method in terminal UI mode
  • --search <text> filter path/body in terminal UI mode
  • --json print machine-readable JSON lines
  • --silent suppress output

Example:

snag listen 3000 --token my-dev-token --json

snag inspect <requestId>

Fetch and print one captured request by ID.

Options:

  • -s, --server <url>
  • --json
  • --silent

Example:

snag inspect req_abc123 --json

snag replay <requestId> --target <url>

Replay a captured request to a target URL.

Options:

  • --target <url> (required)
  • -s, --server <url>
  • --json
  • --silent

Example:

snag replay req_abc123 --target https://httpbin.org/post --json

snag login --email <email>

Starts the magic-link login flow. The CLI requests a magic link, extracts the token, verifies it, and saves the session token locally.

Options:

  • -e, --email <email> (required)
  • -s, --server <url>
  • --token <magicToken> verify directly with a known magic token

Example:

snag login --email [email protected]

Output modes

  • Default: human-readable terminal output
  • --json: machine-readable output for scripts
  • --silent: no output (useful in automation)

Local config

The CLI stores state in:

~/.snag/config.json

Fields:

  • token: default endpoint token
  • serverUrl: default server URL
  • authToken: session token from snag login

Troubleshooting

  • HTTP 401 on authenticated operations: run snag login first.
  • HTTP 404 for inspect/replay: confirm the request ID exists and is accessible.
  • Connection errors: verify --server or SNAG_SERVER_URL points to a live Snag server.

npm README behavior

This README.md is in the package root (packages/cli), which is required for npm package pages.

README changes appear on npm only after publishing a new package version.