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

contextqmd

v0.2.1

Published

`contextqmd` is a standalone CLI for ContextQMD. It talks to the registry API directly and manages a local docs cache and search index powered by QMD (SQLite + BM25 + vector search).

Readme

contextqmd-cli

contextqmd is a standalone CLI for ContextQMD. It talks to the registry API directly and manages a local docs cache and search index powered by QMD (SQLite + BM25 + vector search).

Requires Node.js >= 22.0.0.

Commands

Library Management

contextqmd libraries search "laravel"
contextqmd libraries install laravel --version 12.x
contextqmd libraries install laravel kamal
contextqmd libraries list
contextqmd libraries update laravel
contextqmd libraries remove laravel --version 12.x

Documentation Search & Retrieval

contextqmd docs search "authentication guards" --library laravel --version 12.x --mode hybrid
contextqmd docs get --library laravel --version 12.x --doc-path authentication.md --from-line 120 --max-lines 80

Search modes: fts (full-text), vector, hybrid, auto (default — heuristic picks based on query shape).

Global Flags

| Flag | Description | |------|-------------| | --json | Structured JSON output instead of human-readable text | | --registry <url> | Registry URL (default: https://contextqmd.com) | | --token <token> | Authentication token | | --cache-dir <path> | Local cache directory (default: ~/.cache/contextqmd) |

Architecture

src/
  index.ts              CLI entrypoint (Commander.js argument parsing, IO abstraction)
  lib/
    service.ts          Business logic — install, search, update, remove orchestration
    registry-client.ts  HTTP client for the ContextQMD registry API (uses built-in fetch)
    local-cache.ts      Filesystem cache with atomic installs and backup/restore
    doc-indexer.ts      Search index wrapping @tobilu/qmd (SQLite + BM25 + vector)
    config.ts           Config loader (~/.config/contextqmd/config.json with defaults)
    types.ts            Shared API contract types (Library, Version, Manifest, etc.)

Install pipeline: Resolves library via registry → fetches manifest → tries bundle download (tar.gz with SHA-256 verification) → falls back to page-by-page API download → indexes pages for local search.

Search pipeline: Classifies query (code patterns → FTS, conceptual questions → vector/hybrid) → searches local QMD index → falls back to FTS if vector/hybrid returns empty.

Configuration

Optional config file at ~/.config/contextqmd/config.json:

{
  "registry_url": "https://contextqmd.com",
  "default_install_mode": "slim",
  "preferred_search_mode": "auto",
  "local_cache_dir": "~/.cache/contextqmd",
  "allow_origin_fetch": true,
  "allow_remote_bundles": true,
  "verify_registry_signatures": true
}

All fields are optional — defaults are used for anything not specified.

Development

npm install
npm run build       # compile TypeScript to dist/
npm run check       # type-check without emitting
npm test            # run tests (vitest)
npm link            # symlink the contextqmd binary globally

Dependencies

  • commander — CLI argument parsing
  • @tobilu/qmd — local search index (SQLite + BM25 + vector + LLM reranking)
  • zod — schema validation