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

@howells/cli

v0.2.0

Published

Agent-first CLI harness — structured JSON output, structured errors with retriability + sysexits codes, HTTP error classification, MCP tool envelope helpers, pagination, schema introspection, arg parsing, input hardening. Shared foundation for @howells/th

Readme

@howells/cli

Agent-first CLI harness — structured JSON output, arg parsing, input hardening, and field filtering.

The shared foundation for @howells/thingscli, @howells/starlingcli, and @howells/linearcli.

Install

npm install @howells/cli

Usage

import { success, error, filterFields } from "@howells/cli";
import { flag, hasFlag, readJsonInput, getLimit, getFields, readResult } from "@howells/cli/args";
import { hardenId, validateTitle, validatePositiveInt, validateFields } from "@howells/cli/validate";

// Structured JSON output
success({ balance: "£1,481.14" }, "balance");
// → {"ok":true,"data":{"balance":"£1,481.14"},"command":"balance"}

error("No token found.", "balance");
// → {"ok":false,"error":"No token found.","command":"balance"}

// Arg parsing
const team = flag("team");        // --team ENG → "ENG"
const dryRun = hasFlag("dry-run"); // --dry-run → true
const json = readJsonInput("create"); // --json '{"title":"..."}' → parsed object

// Input hardening (defends against agent hallucinations)
hardenId("../../etc/passwd", "issue"); // exits with error
hardenId("ENG-123", "issue");          // passes

// Context window discipline
readResult("issues", data); // applies --fields and --limit automatically

API

Output (@howells/cli)

| Function | Description | |---|---| | success(data, command?, extra?) | Output JSON success envelope and exit | | error(message, command?) | Output JSON error envelope and exit | | filterFields(items, fields?) | Filter array of objects to specified fields |

Args (@howells/cli/args)

| Function | Description | |---|---| | flag(name) | Get --name value from argv | | hasFlag(name) | Check if --name is in argv | | getLimit(command) | Parse and validate --limit | | getFields(command) | Parse and validate --fields | | readJsonInput(command) | Parse --json '{...}' as object | | readResult(command, data, extra?) | Apply --fields + --limit and output |

Validate (@howells/cli/validate)

| Function | Description | |---|---| | hardenId(value, command, options?) | Reject path traversal, control chars, percent encoding, query params | | validateTitle(value, command, maxLength?) | Reject empty or overly long titles | | validatePositiveInt(value, field, command) | Parse and validate positive integers | | validateFields(value, command) | Validate comma-separated field names |

Design Principles

Built for the Agent DX CLI Scale:

  1. Machine-readable output — JSON envelope on every path, including errors
  2. Context window discipline--fields and --limit are first-class
  3. Input hardeninghardenId() defends against the specific ways agents fail (hallucinated paths, not typos)
  4. Safety railsreadJsonInput() for raw payload input, hasFlag("dry-run") for validation

License

MIT