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

@legukeji/ai-toolkit

v2026.3.19

Published

`@legukeji/ai-toolkit` TypeScript CLI 源码与测试目录。

Readme

CLI

@legukeji/ai-toolkit TypeScript CLI 源码与测试目录。

目录结构

cli/
├─ src/                      # TypeScript CLI 源码
│  ├─ index.ts               # 命令入口
│  ├─ cli.ts                 # 命令定义与参数解析
│  ├─ constants.ts           # 常量定义
│  ├─ fs-utils.ts            # 文件系统工具
│  ├─ model.ts               # 数据模型
│  ├─ project.ts             # 项目配置管理
│  ├─ registry.ts            # 治理包注册表解析
│  ├─ render.ts              # 内容渲染引擎
│  ├─ repository.ts          # 仓库操作
│  ├─ state.ts               # 状态管理
│  ├─ utils.ts               # 通用工具函数
│  ├─ validate.ts            # Schema 验证
│  └─ test-support/          # 测试辅助工具
├─ test/                     # Node.js test 测试用例
│  ├─ fixtures/              # 测试夹具
│  └─ *.test.ts              # 单元测试文件
├─ packages/                 # 发布时同步的治理包(从 ../packages 复制)
├─ shared/                   # 发布时同步的治理内容(从 ../shared 复制)
├─ tools/                    # 发布时同步的工具适配器(从 ../tools 复制)
├─ schemas/                  # 发布时同步的 schema(从 ../schemas 复制)
├─ package.json              # npm 包配置
└─ tsconfig.json             # TypeScript 配置

主要职责

  • 治理包解析:从 npm 包或本地仓库加载 package.yaml 定义
  • 内容渲染:根据工具适配器(Codex、Claude、Gemini、OpenCode)渲染治理内容
  • 项目管理:初始化 .ai-toolkit/project.yaml、管理 manifest 与 lock
  • 更新与冲突检测:基于 baseline 比对实现 diff、update、doctor 命令
  • Schema 验证:验证治理对象、包定义、适配器配置的有效性

支持的命令

ai-toolkit version                      # 输出版本信息
ai-toolkit list --repo .                # 列出治理包与适配器清单
ai-toolkit init --target <dir> ...      # 初始化项目配置
ai-toolkit install --target <dir> ...   # 安装治理内容
ai-toolkit doctor --target <dir> ...    # 健康检查
ai-toolkit diff --target <dir> ...      # 比对差异
ai-toolkit update --target <dir> ...    # 更新治理内容
ai-toolkit pin --target <dir> ...       # 锁定治理包版本
ai-toolkit validate-repo --repo .       # 验证治理仓

开发工作流

# 构建
npm run build

# 运行测试
npm run test

# 端到端测试
npm run test:e2e

# 验证治理仓
npm run validate

发布流程

发布前会自动执行 prepack 脚本,将 shared/packages/tools/schemas/ 复制到包根目录:

npm publish --workspace @legukeji/ai-toolkit

详见 ../scripts/prepare-package.mjs