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

@sgysldz/cli

v1.0.1

Published

开发脚手架

Readme

CLI 功能说明

面向 Git 仓库的交互式命令行工具(Commander 注册子命令,具体操作用 @clack/prompts 问答)。安装本包后的全局命令名为 cli(与 package.jsonbin 所声明一致);cli --help 中的程序名与此相同。

check 外,其余子命令均要求当前工作目录在一个 Git 仓库内;否则会中断并提示。输入未知子命令会报错退出。


全局

| 行为 | 说明 | | --- | --- | | --help | 查看子命令与说明 | | --version | 输出版本号(与 cli/package.jsonversion 一致) |


check

检测当前目录是否为 Git 仓库,在标准输出打印成功或失败提示(不进入交互菜单)。


branch(别名 bm

进入「Git 分支管理器」主菜单,任选一项后按流程交互:

| 菜单项 | 功能 | | --- | --- | | 创建新分支 | 选择类型(feature / bugfix / hotfix / release / chore / refactor / test / docs)→ 读取 git user.name(未配置则中止)→ 输入短名称 → 生成规范分支名并确认 → 检查本地/远程是否已存在 → 创建并切换 → 可选择是否推送到远程 | | 发布当前分支 | 确认后将当前检出的分支推送到远程 | | 重命名分支 | 选择本地分支 → 输入新名(校验不空且不与旧名相同)→ 检查新名是否冲突 → 本地 git branch -m → 若旧分支在远程存在,可选:删旧远程并推送新名 | | 删除分支 | 选择本地分支;若选中的是当前分支,先要求切换到其他分支 → 展示本地/远程是否存在 → 二次确认 → 删本地;若远程存在,可再确认是否删远程 | | 查询上周分支 | 按工具定义的「上周」时间范围列出分支,可选按作者名(模糊、不区分大小写)过滤,输出分支名、作者、时间 | | 查询近 N 天分支 | 输入天数 N → 可选作者过滤 → 列出 从 N 天前 0 点到当天结束 内创建的分支(含边界),输出分支名、作者、时间 |

危险步骤(删除、远程同步)带确认;创建、发布、重命名、删除等操作使用 spinner 提示进行中状态。


log(别名 gitlog

「Git 日志查看器」交互流程:

  1. 可选填写作者(传给 git log --author,留空则不过滤作者)
  2. 输入「最近 N 天」(默认来自配置里的 defaultDays,须为正整数)
  3. 是否追加 --stat 显示文件变更
  4. 使用配置的 --pretty=format: 模板调用 git log,并设置 --since=N.days--date=short

git 执行失败或无输出,会提示未找到日志或命令失败。


tag(别名 t

「Git Tag 管理器」主菜单:

| 菜单项 | 功能 | | --- | --- | | 查看 tag | 并行拉取本地与远程 tag 列表,分块展示(含附注信息时一并显示) | | 新增 tag | 输入名称 → 可选附注(空则创建轻量标签)→ 确认后创建 → 可选是否推送到远程 | | 删除 tag | 从本地 tag 列表选择 → 展示该 tag 在本地/远程是否存在 → 确认后删除本地;若远程存在可再确认删远程 | | 推送到远程 | 筛出「本地有、远程尚无」的 tag;多个时可选「全部推送」或单个 → 确认后推送 |

创建、删除、推送均含确认步骤。


show-branches(别名 sb

并行获取本地与远程分支名,用列表形式输出「本地分支」「远程分支」两组(带加载 spinner)。