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

@yiliang114/cr-bot

v5.0.0

Published

Code Review Bot - Multi-Provider AI Code Review Tool

Readme

@yiliang114/cr-bot

Code Review Bot - 多提供商 AI 代码审查工具

功能特性

  • 🤖 支持多种 AI 提供商(OpenAI GPT-4、阿里云通义千问、阿里云百炼 CodingPlan)
  • 🔗 与 GitHub PR/MR 深度集成
  • 📊 自动生成代码审查报告
  • 🚀 支持命令行工具
  • 🔌 支持自定义 Base URL

安装

npm install -g @yiliang114/cr-bot
# 或
pnpm add -g @yiliang114/cr-bot

使用方式

1. GitHub Actions 集成

在你的仓库中添加 GitHub Secrets:

  • GITHUB_TOKEN - GitHub 访问令牌(通常自动提供)
  • BAILIAN_API_KEY - 百炼 API Key(推荐使用)
  • BAILIAN_BASE_URL - 百炼 Base URL(如:https://bailian.cn-beijing.aliyuncs.com/api/v1)

2. 命令行使用

# 使用默认提供商 (bailian - 百炼 CodingPlan)
cr-tool review owner/repo -i <PR 号码>

# 指定 AI 提供商
cr-tool review owner/repo -i <PR 号码> -p bailian

# 通过命令行传入 API Key 和 Base URL
cr-tool review owner/repo -i <PR 号码> -p bailian --AI_API_KEY your_api_key --BASE_URL https://bailian.cn-beijing.aliyuncs.com/api/v1

环境变量

| 变量名 | 说明 | 必需 | |--------|------|------| | GITHUB_TOKEN | GitHub API 访问令牌 | 是 | | AI_API_KEY | AI 服务 API Key | 是 | | BAILIAN_API_KEY | 百炼 API Key(优先使用) | 否 | | BAILIAN_BASE_URL | 百炼 Base URL | 否 | | BAILIAN_MODEL | 百炼模型名称(如:qwen-max) | 否,默认 qwen-max | | BASE_URL | AI API Base URL(用于 Token 包月服务等) | 否 | | ALIYUN_BASE_URL | 阿里云专属 Base URL | 否 | | OPENAI_BASE_URL | OpenAI 专属 Base URL | 否 | | OWNER | GitHub 仓库所有者 | 否(自动获取) | | REPO | GitHub 仓库名称 | 否(自动获取) | | AI_PROVIDER | AI 提供商 (doubao|openai|aliyun|bailian) | 否,默认 bailian |

AI 提供商配置

OpenAI

export AI_API_KEY="sk-..."
export AI_PROVIDER="openai"

阿里云通义千问(DashScope 原生格式)

export AI_API_KEY="sk-..."
export AI_PROVIDER="aliyun"

阿里云百炼 CodingPlan / Cloud Code(OpenAI 兼容格式 - 推荐)

# 使用阿里云百炼 CodingPlan 的 Token 包月服务
export AI_API_KEY="your-bailian-api-key"
export AI_PROVIDER="bailian"
export BASE_URL="https://coding.dashscope.aliyuncs.com/v1"
# 模型名称(需要从百炼控制台查看应用绑定的模型)
export BAILIAN_MODEL="qwen-max"

注意:如果你使用的是百炼应用(Application),需要从百炼控制台中查看应用绑定的模型名称。

GitHub Actions 示例

基础配置

name: Code Review

on:
  pull_request:
    branches: [main]

permissions:
  contents: write
  pull-requests: write

jobs:
  review:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/setup-node@v4
        with:
          node-version: '20'

      - run: npm install -g @yiliang114/cr-bot

      - name: Code Review
        env:
          GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
          AI_API_KEY: ${{ secrets.AI_API_KEY }}
          AI_PROVIDER: aliyun
        run: cr-tool review ${{ github.repository }} -i ${{ github.event.number }} -p $AI_PROVIDER

使用阿里云百炼 CodingPlan(推荐)

name: Code Review - Bailian CodingPlan

on:
  pull_request:
    branches: [main]

permissions:
  contents: write
  pull-requests: write

jobs:
  review:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/setup-node@v4
        with:
          node-version: '20'

      - run: npm install -g @yiliang114/cr-bot

      - name: Code Review with Bailian
        env:
          GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
          # 百炼 CodingPlan API Key
          AI_API_KEY: ${{ secrets.BAILIAN_API_KEY }}
          # 百炼 CodingPlan Base URL
          BASE_URL: ${{ secrets.BAILIAN_BASE_URL }}
          # 使用 bailian provider (OpenAI 兼容格式)
          AI_PROVIDER: bailian
        run: cr-tool review ${{ github.repository }} -i ${{ github.event.number }} -p $AI_PROVIDER --AI_API_KEY $AI_API_KEY --BASE_URL $BASE_URL

License

MIT