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

snuset

v0.2.4

Published

CLI for the Snuset store — search, cart, and checkout from your terminal

Readme

snuset

Shop snus from your terminal — search the catalogue, manage a cart, and hand off to the browser for checkout.

npx snuset

Runs interactively with no arguments, or accepts subcommands for scripting.

Install

npm install -g snuset
# or run ad-hoc
npx snuset

Requires Node.js 18+.

Usage

snuset                              # interactive REPL
snuset search "general"             # search products
snuset product <slug>               # show a product with variants and pack sizes
snuset cart                         # view active order
snuset cart add <variantId> --quantity 2 --pack-size <id>
snuset cart adjust <lineId> --quantity 3
snuset cart remove <lineId>
snuset cart clear
snuset checkout url                 # print checkout URL (with session handoff)
snuset checkout open                # open checkout in the default browser
snuset login   [--email <e>] [--password <p>]
snuset register [--email <e>] [--password <p>]
snuset whoami
snuset logout
snuset help [--json]                # `--json` prints the command manifest
snuset --version

Add --json to any command for machine-readable output.

Using snuset from an AI agent (Claude Code, OpenAI, etc.)

The CLI is designed so an agent can drive it without any TUI affordances.

Machine-readable output. Pass --json or just pipe it — when stdout is not a TTY, --json is enabled automatically. All stdout is a single JSON document per command; colors and spinners are suppressed. snuset help --json prints the full command manifest.

No hidden prompts. In --json / non-TTY mode the CLI never asks for input. Missing required arguments return a structured error instead of blocking on stdin:

{ "error": "Missing required argument: --variant", "code": "MISSING_ARG" }

Exit code is 1 on any error. Check code for branching: MISSING_ARG (agent forgot a flag), NO_TTY (agent invoked snuset with no subcommand). Unhandled errors from the API bubble up as { "error": "<message>" } without a code.

Session is file-based. snuset login --email … --password … writes a token to ~/.snuset-cli/session.json (or $XDG_STATE_HOME/snuset-cli/session.json). Subsequent calls in any process read it automatically, so an agent can log in once and then run many cart/search commands in separate invocations. Override the path with SNUSET_CLI_SESSION_PATH=/tmp/snuset.json to isolate sessions per run.

Typical agent flow:

snuset login --email $USER_EMAIL --password $USER_PASS --json
snuset search "general" --json | jq '.hits[0].productVariantId'
snuset cart add <variantId> --quantity 2 --pack-size <packSizeId> --json
snuset cart --json
snuset checkout url --json       # hand the URL to the user for payment

Do not invoke snuset with no arguments from an agent — that opens the interactive REPL and will error out with code: "NO_TTY" under automation. Always pass a subcommand.

Discover commands programmatically with snuset help --json, which returns { name, version, commands: [...], globalFlags: [...] }.

Agent skill. A ready-made skill for Claude Code, OpenCode, Cursor, and others is published at snuset/skills. Install it with npx skills:

npx skills add snuset/skills            # pick agents + skills interactively
npx skills add snuset/skills -s cli     # just the CLI skill

Checkout handoff

checkout open / checkout url appends the current session as a URL fragment (#cli_token=…) so the storefront can resume the cart in the browser without re-authentication. Agents should prefer checkout url and hand the URL back to the user — checkout open will launch a browser on the machine the CLI runs on, which is rarely where the user is.

License

MIT