New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details →
Socket
Book a DemoSign in
Socket

openspec-stat

Package Overview
Dependencies
Maintainers
1
Versions
15
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

openspec-stat

Track team members' OpenSpec proposals and code changes in Git repositories

latest
Source
npmnpm
Version
1.4.5
Version published
Maintainers
1
Created
Source

openspec-stat

NPM version NPM downloads Last commit CI License

English | 简体中文

A CLI tool for tracking team members' OpenSpec proposals and code changes in Git repositories.

Install

# global install
npm install -g openspec-stat
# or local (dev dependency)
npm install -D openspec-stat

Quick start

Default window: yesterday 20:00 → today 20:00.

# basic run
openspec-stat

# custom time range
openspec-stat --since "2024-01-01 00:00:00" --until "2024-01-31 23:59:59"

# multi-repo (uses config)
openspec-stat multi -c .openspec-stats.multi.json

Key features

  • Track Git commits in a time window and per-branch filters
  • Detect commits containing both OpenSpec proposals and code changes
  • Proposal-based aggregation to avoid merge-commit bias
  • Author grouping with name mapping (multiple Git identities per person)
  • Multi-branch wildcards and multi-repository mode (BETA)
  • Outputs: table, JSON, CSV, Markdown; languages: en / zh-CN

Common flags (full list: openspec-stat --help)

  • -r, --repo <path>: repository path (default: current directory)
  • -b, --branches <list>: comma-separated branches, supports wildcards
  • -s, --since <datetime> / -u, --until <datetime>: time window
  • -a, --author <name>: filter by author
  • -c, --config <path>: config file
  • --json | --csv | --markdown: output format
  • -l, --lang <language>: en or zh-CN
  • -v, --verbose: verbose output

Multi-repo mode (BETA)

Analyze multiple local/remote repositories in one run.

openspec-stat init --multi                         # interactive setup
openspec-stat multi -c .openspec-stats.multi.json  # aggregated view
openspec-stat multi -c .openspec-stats.multi.json --show-contributors

See Multi-Repository Guide for full details.

Remote cache: remote repos are cloned once and reused under ~/.openspec-stat/cached/repos/<repo-name>-<hash>. Use --cache-mode temporary to force one-off clones, or --force-clone to refresh a single run.

Configuration (short)

Create .openspec-stats.json or openspec-stats.config.json in the repo root.

{
  "defaultBranches": ["origin/master", "origin/main", "origin/release/*"],
  "defaultSinceHours": -30,
  "defaultUntilHours": 18,
  "authorMapping": {"john.doe@company.com": "John Doe"},
  "openspecDir": "openspec/",
  "excludeExtensions": [".md", ".txt", ".png", ".jpg", "..."],
  "activeUserWeeks": 2
}

Key fields: default branches/time window, author mapping (merge identities), OpenSpec directory, excluded extensions, active user window.

Output

📊 OpenSpec Report
Time: 2024-01-01 00:00:00 ~ 2024-01-31 23:59:59
Branches: origin/master
Total Commits: 8

Proposal Summary
┌──────────────┬─────────┬───────────┬───────────┐
│ Proposal     │ Commits │ Files     │ Net Δ     │
├──────────────┼─────────┼───────────┼───────────┤
│ feature-123  │ 5       │ 30        │ +656      │
└──────────────┴─────────┴───────────┴───────────┘

Author Summary
┌─────────┬─────────┬───────────┬───────────┐
│ Author  │ Commits │ Proposals │ Net Δ     │
├─────────┼─────────┼───────────┼───────────┤
│ John D. │ 8       │ 3         │ +667      │
└─────────┴─────────┴───────────┴───────────┘

Use --markdown, --json, or --csv for other formats.

Language

--lang en (default) or --lang zh-CN. Locale-based auto-detection is also supported.

Development

pnpm install
pnpm dev
pnpm build
node dist/cjs/cli.js

Contributing & Release Process

  • See CONTRIBUTING.md for development setup and PR expectations.
  • See RELEASE.md for the Changesets-driven publishing workflow.

License

MIT

Keywords

openspec

FAQs

Package last updated on 04 Feb 2026

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts