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

@zdthfhxh/ai-code-review-cli

v0.1.2

Published

AI-powered code review CLI — 在终端里审查代码,支持 DeepSeek、OpenAI、Ollama

Readme

AI Code Review

AI 代码审查 CLI 工具 — 在终端里审查代码改动,支持 DeepSeek、OpenAI、Ollama

License: MIT Node

为什么做这个?

代码审查很重要,但找人 review 很慢,自己 review 容易漏掉问题。AI Code Review 从你的 git diff 自动分析代码,找出潜在的问题,就像有一个资深的代码审查专家随时待命。

参考框架: Open Core 模式(开源核心 + 付费高级功能) 对标项目: reviewdog(8.4k stars)+ pr-agent(5k stars)+ code-review-gpt(1.8k stars)

特性

| 功能 | 免费版 | Pro 版 | |:---|:---:|:---:| | 代码审查(AI 分析) | ✅ | ✅ | | 多 Provider 支持(DeepSeek/OpenAI/Ollama) | ✅ | ✅ | | 终端输出 | ✅ | ✅ | | JSON/SARIF 输出 | ✅ | ✅ | | 指定文件审查 | ✅ | ✅ | | 指定 commit 审查 | ✅ | ✅ | | 严重级别过滤 | ❌ | ✅ | | 团队规范检查 | ❌ | ✅ | | CI/CD 集成(GitHub Action) | ❌ | ✅ | | 自动修复建议 | ❌ | ✅ |

快速开始

安装

# 全局安装
npm install -g @zdthfhxh/ai-code-review-cli

# 或者直接运行
npx @zdthfhxh/ai-code-review-cli

配置

# 设置 API 密钥(DeepSeek 默认)
ai-review config set AI_API_KEY sk-your-key

# 或者使用 OpenAI
ai-review config set AI_API_KEY sk-your-openai-key
ai-review config set AI_PROVIDER openai
ai-review config set AI_API_BASE https://api.openai.com/v1

使用

# 审查当前分支的改动
ai-review

# 审查指定文件
ai-review src/index.js

# 审查已暂存的改动
ai-review --staged

# 审查指定 commit
ai-review --commit abc123

# 使用 OpenAI
ai-review --provider openai --model gpt-4

# 输出 JSON 格式
ai-review --output json

# 查看 AI 会收到什么(不实际调用)
ai-review --dry-run

环境变量

所有配置项也可以通过环境变量设置:

AI_REVIEW_AI_API_KEY=sk-your-key
AI_REVIEW_AI_PROVIDER=deepseek
AI_REVIEW_AI_MODEL=deepseek-chat
AI_REVIEW_REVIEW_LANGUAGE=zh

输出示例

📋 代码审查报告
──────────────────────────────────────────────────
  发现 5 个问题,其中 1 个严重,2 个高优先级
──────────────────────────────────────────────────

🔴 [严重] SQL 注入风险:用户输入未经过滤直接拼接
   📁 src/user.js:42
   用户输入直接用于数据库查询,存在 SQL 注入风险
   💡 使用参数化查询代替字符串拼接

🟠 [高] 未处理的 Promise 错误
   📁 src/api.js:15
   async 函数中没有 try-catch,错误会导致进程崩溃
   💡 添加 try-catch 或使用 .catch()

对比

| 工具 | 类型 | AI | Price | CLI | |:----|:----|:--:|:-----:|:---:| | ai-code-review | CLI | ✅ | 免费 + Pro $9/月 | ✅ | | CodeRabbit | GitHub App | ✅ | $12/月 | ❌ | | pr-agent | GitHub App | ✅ | 免费 + $49/月 | ❌ | | reviewdog | CLI | ❌ | 免费 | ✅ | | code-review-gpt | CLI | ✅ | 免费 | ✅ |

许可证

MIT