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

speccy-cli

v0.13.1

Published

Lint OpenAPI documents and report breaking changes from the command line.

Readme

speccy-cli

Lint OpenAPI documents and report breaking changes from the command line, so the same analysis the Speccy renderer shows in the browser can run in CI.

npm install --save-dev speccy-cli

Requires Node.js 22 or newer.

Commands

speccy lint <spec> [options]
speccy diff <base> <revision> [options]

Every spec argument accepts three forms:

  • an http or https URL
  • a file path, openapi.yaml
  • a git ref, main:openapi.yaml or origin/main:api/openapi.yaml

Resolution tries a URL first, then an existing file, then a git ref, so a local file whose name contains a colon shadows the same-named ref.

That makes the common CI comparison a one-liner:

speccy diff origin/main:openapi.yaml openapi.yaml

If the diff base ref exists but does not contain the file, the spec is new on this branch and diff exits clean. A missing revision or lint target is an error. If the ref itself is unreachable, which usually means a shallow clone, the command says so rather than reporting your whole API as added.

Bundle multi-document specs

speccy-cli doesn't include a bundle command. Use the open-source Redocly CLI to create a standard YAML or JSON document before passing it to tools that don't load external references:

npx redocly bundle openapi.yaml --output openapi.bundled.yaml

Options

| Option | Meaning | | ----------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | | --format <pretty\|json\|markdown> | Output shape. pretty for a terminal, json for anything downstream, markdown for a pull request comment. Defaults to pretty. | | --fail-on <severity> | Exit 1 at or above this severity. Lint takes issue, warning, suggestion, or never, defaulting to issue. Diff takes breaking, warning, compatible, documentation, or never, defaulting to breaking. | | --against <spec> | Adds change-safety findings to a lint by comparing against a previous document. | | --material | For diff, ignore description fields and x- extension properties at every level. Use it when reviewing contract changes without editorial or tool-specific metadata. | | --no-color | Never colorize terminal output. NO_COLOR is respected too. | | --help, -h | Print usage and exit 0. |

Repository configuration

Add an optional .speccyrc JSON file to configure rules. The CLI reads it from the directory it runs in, so run speccy from the directory containing .speccyrc; the GitHub Action runs at the workspace root and picks up a root-level file. speccy:recommended is the default preset. A rule accepts true, false, a severity, or an options object:

{
  "extends": ["speccy:recommended"],
  "rules": {
    "new-operation-lifecycle": {
      "severity": "suggestion",
      "maxAgeDays": 30,
      "allowedStages": ["new", "coming-soon", "beta", "early-access"]
    },
    "request-example": false,
    "response-example": "warning"
  },
  "ignore": [
    {
      "rules": ["operation-security", "request-example"],
      "paths": ["/public/**"]
    }
  ]
}

Scoped ignores use * within one path segment and ** across segments. Unknown rules, properties, severities, and options are rejected, so a typo cannot silently weaken review. Contract-correctness rules such as operation-id-unique and path-parameter-declared cannot be disabled or ignored.

When linting with --against, new-operation-lifecycle suggests adding lifecycle metadata to newly added operations. Add a date and any lint, with or without --against, suggests removing the badge after maxAgeDays; that finding reports under the new-operation-lifecycle-expired rule ID while reading its maxAgeDays from the new-operation-lifecycle setting:

x-speccy-lifecycle: new
x-speccy-lifecycle-since: 2026-08-13

The GitHub Action uses change-aware linting, so it follows the same configuration.

Exit codes

| Code | Meaning | | ---- | ---------------------------------- | | 0 | Nothing at or above the threshold | | 1 | Findings at or above the threshold | | 2 | The tool could not run |

Code 2 is deliberately separate: a spec that will not parse is a different problem from a spec with breaking changes, and CI should be able to tell them apart.

In a workflow

- uses: actions/checkout@v4
  with:
    fetch-depth: 0
- run: npx speccy-cli diff origin/main:openapi.yaml openapi.yaml --format markdown >> "$GITHUB_STEP_SUMMARY"

fetch-depth: 0 matters. The default shallow checkout has no origin/main to read the base from.

License

MIT