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

pspt-cli

v2.0.0

Published

pspt CLI: compile/build .pspt files and scan git history.

Readme

pspt-cli

The pspt command-line tool: compiles/runs .pspt DSL files and scans git history for use in trackers.

Running it

pspt-cli is published on npm, so the pspt command works globally once installed:

npm install -g pspt-cli
pspt <command> [args]
# or, without installing:
npx pspt-cli <command> [args]

Working from inside this monorepo without installing the published package, invoke the bin directly with node instead:

node packages/pspt-cli/bin/pspt.js <command> [args]

Both invocation styles are identical — the commands below apply either way.

Commands

pspt compile

pspt compile <file>.pspt

Compiles a .pspt source file to <file>.gen.js next to it (plain JS calling pspt-docx/pspt-xlsx setters — see pspt-lang for what the generated code looks like). Does not run it.

Prints Compiled <file> -> <file>.gen.js (type=<docType>) on success, where <docType> is the type= from the file's doc line (master, a Part key such as projectBrief, or xlsx).

On a lex/parse error, prints pspt: <file>: Line N, col M: <message> and exits with a non-zero status — no partial .gen.js is written.

Always check the generated .gen.js for // WARNING: comments after compiling — the DSL compiles successfully even when a field/table has no matching setter, or a rows block doesn't match any declared table; those cases are flagged with a warning comment rather than failing the build.

pspt build

pspt build <file>.pspt --out <output-path>

Compiles the .pspt file (same as compile) and immediately executes its generated build() function, writing the final .docx/.xlsx to --out.

If --out is omitted, defaults to output.docx or output.xlsx depending on the file's declared type=.

pspt build examples/fixtures/sample-docx.pspt --out out/spec.docx
pspt build examples/fixtures/sample-xlsx.pspt --out out/tracker.xlsx

pspt scan-git

pspt scan-git <repo-path...> [--since <date>] [--out <file>.json] [--with-lines]

Scans one or more git repositories and writes the results as a single JSON file. Replaces the old ad hoc docs/scan-commits.js / docs/scan-agentic-repos.js scripts from the original codebase.

| Flag | Default | Meaning | | ---------------- | --------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | --since <date> | (all history) | Passed straight to git log --since=<date> (e.g. 2026-01-01). | | --out <file> | scan-git.json | Output JSON path. | | --with-lines | off | Also run git show --shortstat per commit to attach {insertions, deletions} to each entry. Costs one extra git process per commit — fine for tens/hundreds of commits, slow for very large histories. Omit it if you only need commit metadata (hash/date/author/subject). |

Multiple repo paths can be passed at once; each becomes its own entry in the output array, named after the repo's directory basename:

pspt scan-git ../project-tracker ../project-tracker-api --since 2026-01-01 \
  --out scan.json --with-lines

Output shape (one object per repo):

{
  "name": "project-tracker",
  "url": "https://github.com/you/project-tracker", // from `git config remote.origin.url`, null if unavailable
  "path": "../project-tracker",
  "remote": "https://github.com/you/project-tracker",
  "branches": "  main\n  remotes/origin/main\n...",
  "commits": [
    {
      "hash": "5b2e629",
      "date": "2026-07-27",
      "author": "Jane Doe",
      "email": "<[email protected]>",
      "subject": "refactor: remove unused assignees handling functions",
      "insertions": 3, // only present with --with-lines
      "deletions": 63, // only present with --with-lines
    },
  ],
  "error": null, // set instead of `commits` populating, if `git log` itself failed
}

Using the results in a tracker: copy the relevant commitCount/lines values into your .pspt file's task attributes, or compute a summed total across several commit hashes for one task with pspt-core's getCommitStats:

const { getCommitStats } = require('pspt-core');
const stats = getCommitStats('../project-tracker', ['5b2e629', '3915fe1']);
// -> { commitCount: 2, insertions: 27, deletions: 71, lines: '+27 / -71' }

See pspt-xlsx's task-field docs for where commitCount/lines land in the generated spreadsheet.

Usage / help

Running pspt with no command, or an unrecognized one, prints full usage:

node packages/pspt-cli/bin/pspt.js

Errors

All commands report failures as pspt: <message> on stderr and set a non-zero exit code — this includes DSL lex/parse errors (with line/column), missing required positional arguments (falls back to printing usage), and any runtime error thrown while generating the final document (e.g. a filesystem error writing the output path).