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

effective-command

v0.2.2

Published

Local AI command toolbox for individual developers.

Downloads

284

Readme

effective_command

面向个人开发者的本地 AI 命令工具。

当前 MVP 提供两个命令:根据当前 Git 仓库里尚未提交的代码变更生成 commit message,或对这些变更做一次本地 review。

命令

ec commit
ec review

ec commit

默认行为:

  1. 检查当前目录是否是 Git 仓库。
  2. 检查是否存在未提交变更。
  3. 调用本地 codex exec
  4. 让 Codex 自行读取 git status --shortgit diff HEAD --statgit diff HEAD
  5. 用边框输出一条 commit message。
  6. 询问是否使用这条 message 执行 git commit

确认提示:

Use this message and run git commit? [Y/n]

直接按 Enter 默认执行提交,输入 n 则只输出 message,不提交。

ec commit 默认不会把 Codex 的中间过程或完整 git diff 打到终端里;只有最终 commit message 和必要的状态信息会显示出来。Codex 或 git commit 长时间运行时,会定期输出仍在运行的状态提示。

ec review

默认行为:

  1. 检查当前目录是否是 Git 仓库。
  2. 检查是否存在未提交变更。
  3. 调用本地 codex exec
  4. 让 Codex 自行读取 git status --shortgit diff HEAD --statgit diff HEAD
  5. 用彩色标题、分隔线和自动换行输出审查结果。

ec review 只输出建议,不会修改文件,也不会执行 git commit

使用

本地需要已经安装并登录 Codex CLI:

codex --help
codex login

本仓库内直接运行:

./bin/ec.js commit

安装后运行:

npm install -g effective-command
ec commit
ec review

本地开发时可以把当前仓库链接为全局命令:

npm link
ec commit
ec review

取消本地链接:

npm unlink -g effective-command

参数

ec commit --lang zh-CN
ec commit --style conventional
ec commit --model gpt-5
ec commit --profile work
ec commit --copy
ec commit --log
ec review --lang zh-CN
ec review --model gpt-5
ec review --log

参数说明:

  • --lang <locale>:输出语言,默认 zh-CN
  • --style <style>:commit 风格,默认 conventional,仅用于 ec commit
  • --model <model>:透传给 codex exec --model
  • --profile <profile>:透传给 codex exec --profile
  • --copy:生成后尝试复制到剪贴板,仅用于 ec commit
  • --log:打印更详细的运行日志,包括当前仓库上下文、实际执行的 Codex/Git 命令,以及 Codex 或 Git 子进程输出。

环境变量:

EFFECTIVE_COMMAND_LANGUAGE=zh-CN
EFFECTIVE_COMMAND_MODEL=gpt-5
EFFECTIVE_COMMAND_CODEX_PROFILE=work

发布

发布前检查:

npm run check
npm pack --dry-run

升级版本:

npm version patch --no-git-tag-version

也可以按需要使用:

npm version minor --no-git-tag-version
npm version major --no-git-tag-version

登录 npm:

npm login
npm whoami

发布:

npm publish --otp=你的验证码或recovery_code

npm 不允许覆盖已经发布过的版本。如果发布时报:

You cannot publish over the previously published versions

需要先升级 package.json 里的版本号,再重新发布。

安装最新版本:

npm install -g effective-command@latest
ec --help

如果本机已经安装过旧版本,可以强制更新:

npm install -g effective-command@latest --force

Prompt

ec commitec review 都不把 diff 内容塞进 prompt,也不通过 stdin 传代码。它们只提供任务说明,让 Codex 在本地仓库中自己读取变更。

核心提示词形态:

You are running inside a local Git repository. Generate a high quality Git commit message by inspecting the local uncommitted changes yourself with read-only commands.

Suggested commands:
- git status --short
- git diff HEAD --stat
- git diff HEAD

Output language: zh-CN
Commit style: conventional

Rules:
- Return only the commit message.
- Do not wrap it in markdown.
- Do not explain your reasoning.
- First line must be <= 72 characters.
- If style is conventional, use "type(scope): summary" when a scope is obvious.
- Add a short body with bullets only when it adds useful context.
- Do not mention files mechanically unless it clarifies the behavior change.

Do not modify files. Do not run git commit.

当前结构

effective_command/
  README.md
  package.json
  bin/
    ec.js
  src/
    main.js

后续方向

先把 ec commitec review 做稳定,再考虑增加其他命令。暂时不做:

  • ec config
  • ec summary
  • 插件系统
  • 多 provider 管理
  • 直接管理 API key