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

@grafema/cli

v0.3.29

Published

CLI for Grafema code analysis toolkit

Readme

@grafema/cli

Build a graph of your code, then query it like a database.

Grafema turns your codebase into a queryable graph: functions, calls, dataflow, types, exports, side effects. Use it to answer structural questions that grep can't reach: "who calls this", "where does this value come from", "did anyone change the contract of this endpoint".

Status: beta — APIs may shift between minor versions.


Five-minute tour

npx @grafema/cli init                              # one-time setup
npx @grafema/cli analyze                           # build the graph (1-2 min on a typical repo)
npx @grafema/cli tldr packages/cli/src/cli.ts     # 30-second file overview
npx @grafema/cli who handleRequest                # find every caller
npx @grafema/cli wtf userId                       # backward dataflow trace

Install globally with npm i -g @grafema/cli to drop the npx prefix.


Common workflows

"I just cloned this repo, what is it?"

grafema init                # writes .grafema/config.yaml
grafema analyze             # populates the graph
grafema overview            # node/edge counts, ISSUE summary
grafema tldr <key file>     # structural overview, 10-20× shorter than source

"Where does this value come from?"

grafema wtf <symbol>            # backward dataflow
grafema trace --to <sink-spec>  # all-paths-to a sink

"Who uses this function?"

grafema who <symbol>          # resolved call sites
grafema impact <node>         # downstream impact set

"Why is the code structured this way?"

grafema why <symbol>          # decisions / facts in the knowledge base

"Did I break anything?" (CI gate)

grafema check                 # runs every guarantee, exits non-zero on violations
grafema doctor                # local environment health check

"Generate documentation from the graph"

grafema export --feature 'cli:command' --as docs-md   > cli-reference.md
grafema export --feature 'mcp:tool'    --as mcp-schema > mcp-tools.json
grafema export --feature 'http:route'  --as openapi-3.1 > openapi.yaml

All commands

The full per-command catalogue with flags, defaults, examples, and captured output lives in docs/cli-reference.md.

That document is regenerated from the live graph on each release via:

grafema export --feature 'cli:command' --as docs-md --output docs/cli-reference.md

If you change a flag, description, or option in source, the reference updates automatically on next build. No drift between code and docs.


Notes

  • All commands accept --project <path> to point at a specific repo. Defaults to the current directory.
  • For AI integration via MCP, see @grafema/mcp.
  • For VS Code integration, see @grafema/vscode.
  • Datalog --raw queries fail open with a helpful warning if predicates are unknown — typos won't crash a script.