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

@yuchenrx/pmt-cli

v0.1.3

Published

用于统一管理/同步规范与提示文件的 CLI。

Readme

pmt

用于统一管理/同步规范与提示文件的 CLI。

English | 简体中文

npm version release platform

概览

  • 全局集中管理 prompt/spec 文件(prompts_root)。
  • 在任意项目创建 link 文件(硬链接 -> 软链接 -> meta-link 降级)。
  • 后台追踪 link 重命名/移动(只监听已有目录,不全盘扫描)。
  • status 查看所有 link 状态(不扫描磁盘)。

快速开始

1)初始化全局 prompt 仓库:

pmt init

2)交互选择一个 prompt 并创建 link:

pmt link

3)或指定 prompt 名:

pmt link rules

4)或指定目标路径:

pmt link rules docs/AGENTS.md

5)查看 link 状态:

pmt status

安装

npm(Windows)

npm i -g @yuchenrx/pmt-cli

该包发布的是 Windows 二进制文件,其他平台请从源码构建。

源码安装

要求:Bun。

bun install
bun run pmt

命令

常用命令:

  • pmt init:初始化全局配置 / prompt root
  • pmt set <name> <file> [scope]:保存一个命名 source(本地路径/URL)
  • pmt use <name> [scope]:切换当前 source
  • pmt link [name] [file] [scope]:创建 link 文件(不传 name 默认交互选择;-i 可强制交互)
  • pmt status:查看 link 状态
  • pmt open-config [scope](别名 open):打开配置所在文件夹
  • pmt insert <file>:插入占位符
  • pmt apply [files...]:将当前 source 应用到目标文件

查看完整参数:

pmt --help
pmt <command> --help

配置

配置文件:

  • 项目配置:.promptslotrc.json
  • 全局配置:~/.promptslotrc.json
  • 链接记录:.promptslot-links.json
  • 索引文件:.promptslot-index.json

常用字段:

  • prompts_root:全局 prompt 仓库目录
  • prompts_dir:项目 prompts 目录(fallback)
  • link_default:默认 link 文件名
  • sources:name -> 文件路径/URL
  • current:当前激活的 source 名

最小示例(.promptslotrc.json):

{
  "prompts_root": "C:/Users/you/prompts",
  "link_default": "AGENTS.md"
}

链接模式

1)硬链接:文件系统级实时同步 2)软链接:文件系统级实时同步 3)Meta-link:头部 + hash(无法链接时降级)

Meta-link 用于跨盘、只读或 URL 等场景。

重命名追踪

  • 创建 meta-link 后自动启动后台重命名守护。
  • 仅监听已有 link 文件所在目录。
  • 不做全盘扫描,仅更新 .promptslot-links.json

构建

bun run build

输出:dist/pmt.exe

发布(维护者)

通过 GitHub Actions 自动发布:push tag 即触发。

1)创建并推送 semver tag:

git tag vX.Y.Z
git push origin vX.Y.Z

2)工作流 .github/workflows/release.yml 会:

  • 执行 bun test
  • 构建 dist/pmt.exe
  • 创建 GitHub Release,并上传二进制
  • 发布 npm 包(npm publish --access public

注意:

  • 如果 npm 账号开启了“发布需要 2FA”,CI 必须使用可绕过 OTP 的 token(Automation token 或启用 bypass 2FA 的 granular token),否则 npm publish 会报 EOTP

CLI 名称覆盖

CLI_NAME=pmt