
Security News
Attackers Are Hunting High-Impact Node.js Maintainers in a Coordinated Social Engineering Campaign
Multiple high-impact npm maintainers confirm they have been targeted in the same social engineering campaign that compromised Axios.
@perryfinn/ai-commit-cli
Advanced tools
一个利用 AI 服务(OpenAI、Dify 等)自动生成遵循指定标准的提交信息并处理提交过程的命令行工具。用 AI 消灭低价值 commit。🥳
本项目受 opencommit 的启发
strict、noUncheckedIndexedAccess 等).d.ts)与 Source Mappackage.json#exports、main、module、types)bunfig.toml)scripts/changeset.commit.ts)attw(AreTheTypesWrong)导出与类型正确性校验请参阅 Repository Guidelines 了解项目结构、开发流程与提交规范。
bun install
注:仓库在
bunfig.toml中启用了linker = "isolated",安装结果类似 pnpm 的非平铺结构;若需切换策略,请先删除现有node_modules/。
构建 CLI:
bun run build
配置(AIGCM_ 前缀,默认 Provider=OPEN_AI,Language=zh_CN):
node ./dist/index.cjs config set AIGCM_MODEL_ID=gpt-4o AIGCM_ONE_LINE_COMMIT=true AIGCM_MAX_TOKEN_INPUT=1024
node ./dist/index.cjs config get AIGCM_MODEL_ID
node ./dist/index.cjs config ls
Debug 示例(脚本同 package.json#scripts.debug):
bun run debug
从高到低(上层存在即覆盖下层):
AIGCM_*).env 文件中的 AIGCM_*补充说明:
config set 仅写入配置文件层,不会修改环境变量或 .env。config get/config ls 会在值后显示来源标识:[cli]、[.env] 或 [config]。当你将本模板产物发布到 npm 后,可按如下方式在其他项目中使用。
ESM:
import { add, type DemoType } from 'create-npm-package';
const result = add(2, 3);
console.log(result); // 5
const user: DemoType = { name: 'Tom' };
CJS:
const { add } = require('create-npm-package');
console.log(add(2, 3)); // 5
bun run lint:Biome 检查bun run lint:fix:Biome 自动修复bun run typecheck:TypeScript 类型检查bun run test:Vitest 全量测试bun run test:watch:Vitest 监听模式bun run test:coverage:生成覆盖率报告bun run build:使用 tsdown 打包(CJS/ESM + d.ts + sourcemap → dist/)bun run check:exports:使用 attw 校验导出与类型bun run release:version:根据变更集生成版本号与 CHANGELOGbun run release:发布到当前 registry(需已登录)bun run ci:本地串跑 CI(lint → typecheck → test → build → check:exports)bun run build:changeset:编译 scripts/changeset.commit.ts 为 .changeset/changeset.commit.cjs说明:
prepublishOnly会在发布前自动执行bun run ci,确保发布质量。
.
├─ src/
│ ├─ index.ts # CLI 入口
│ ├─ cli/ # 子命令与解析器
│ ├─ config/ # 配置管理
│ ├─ types/ # 类型与 JSON Schema
│ ├─ utils/ # 工具函数(含 env 解析)
│ └─ utils.ts # 通用工具
├─ tests/
│ └─ utils.test.ts # Vitest 示例用例
├─ scripts/
│ └─ changeset.commit.ts # Changesets 自定义提交消息生成逻辑
├─ dist/ # 构建产物(build 后生成)
├─ tsdown.config.ts # 打包配置(含 changeset 构建目标)
├─ vitest.config.ts # 测试配置(V8 覆盖率)
├─ bunfig.toml # Bun 配置(覆盖率阈值、registry)
├─ tsconfig.json # TypeScript 配置(严格模式等)
├─ package.json # 脚本、导出映射、引擎/工具声明等
└─ CHANGELOG.md # 版本变更记录(由 Changesets 生成)
src/index.tsdist/index.js(ESM)index.cjs(CJS)index.d.ts / index.d.cts(类型声明)*.map(Source Map)package.json#exports,同时提供 main/module/types 字段方便生态工具识别。使用 Vitest,覆盖率提供方为 V8:
bun run test
bun run test:coverage
添加变更集(选择变更类型并填写说明):
bunx changeset
生成版本号与变更日志:
bun run release:version
发布到 npm(或当前 registry):
bun run release
可选:若需自定义 Changesets 的提交消息格式,执行:
bun run build:changeset
该命令会将 scripts/changeset.commit.ts 编译为 .changeset/changeset.commit.cjs,供 Changesets 读取使用。
bun.lock。nvm 切换到合适版本。仓库使用 Volta 固定为 22.19.0。attw 检查失败?
bun run build && bun run check:exports。MIT © PerryFinn
FAQs
一个利用 AI 服务(OpenAI、Dify 等)自动生成遵循指定标准的提交信息并处理提交过程的命令行工具。用 AI 消灭低价值 commit。🥳
We found that @perryfinn/ai-commit-cli demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?

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.

Security News
Multiple high-impact npm maintainers confirm they have been targeted in the same social engineering campaign that compromised Axios.

Security News
Axios compromise traced to social engineering, showing how attacks on maintainers can bypass controls and expose the broader software supply chain.

Security News
Node.js has paused its bug bounty program after funding ended, removing payouts for vulnerability reports but keeping its security process unchanged.