{"_id":"@buxuku/ai-code-reviewer","_rev":"4-b5e6dbf3d39806012879f04118c95b99","name":"@buxuku/ai-code-reviewer","dist-tags":{"latest":"1.2.2"},"versions":{"1.0.0":{"name":"@buxuku/ai-code-reviewer","version":"1.0.0","main":"index.js","bin":{"ai-code-reviewer":"bin/index.js"},"scripts":{"start":"tsc --watch","build":"tsc"},"license":"MIT","dependencies":{"@types/axios":"^0.14.0","@types/commander":"^2.12.2","@types/node":"^20.2.1","axios":"^1.4.0","commander":"^10.0.1","typescript":"^5.0.4"},"publishConfig":{"access":"public","registry":"https://registry.npmjs.org/"},"gitHead":"ce5e0e61a3e670f58efdebe7c46e23447425d2dc","_id":"@buxuku/ai-code-reviewer@1.0.0","_nodeVersion":"16.13.0","_npmVersion":"8.1.0","dist":{"integrity":"sha512-be/C5TYgkUIwFCPCtUn756+mxbj4Jauu+O+RB+zgQQ5MJ2HhE8MEi7Up27hvw3dvlsUa2koM4pF6wyoR0VUVmA==","shasum":"b0d13a6ace326f28325f373a129d118f14df5db3","tarball":"https://registry.npmjs.org/@buxuku/ai-code-reviewer/-/ai-code-reviewer-1.0.0.tgz","fileCount":8,"unpackedSize":18002,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIGsTZZ4FKxSvuG1BDpZoMebcMojxME05o4mOICP3xm00AiAOH+rApt6fy2OAhoj/4f5sYoZGzpd17hNT/Xikloi0yw=="}]},"_npmUser":{"name":"xd-js","email":"buxuku@gmail.com"},"directories":{},"maintainers":[{"name":"xd-js","email":"buxuku@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/ai-code-reviewer_1.0.0_1684815624019_0.6359650570489677"},"_hasShrinkwrap":false},"1.1.0":{"name":"@buxuku/ai-code-reviewer","version":"1.1.0","main":"index.js","bin":{"ai-code-reviewer":"bin/index.js"},"scripts":{"start":"tsc --watch","build":"tsc"},"license":"MIT","dependencies":{"@types/axios":"^0.14.0","@types/commander":"^2.12.2","@types/node":"^20.2.1","axios":"^1.4.0","commander":"^10.0.1","typescript":"^5.0.4"},"publishConfig":{"access":"public","registry":"https://registry.npmjs.org/"},"gitHead":"3a958dee9e7f75775a99978a7677daca963dd207","_id":"@buxuku/ai-code-reviewer@1.1.0","_nodeVersion":"16.13.0","_npmVersion":"8.1.0","dist":{"integrity":"sha512-bdleg8A+yE3bKv/N+gPYjvgp71BnER05rEJ12H+ck0+A3ijU5rz8eo+CMiZtX+OArgw2uoQjQzwuRv2OrzyKgA==","shasum":"202b8a5331167b10fde3834030eb2e9813d6adc6","tarball":"https://registry.npmjs.org/@buxuku/ai-code-reviewer/-/ai-code-reviewer-1.1.0.tgz","fileCount":8,"unpackedSize":18397,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDeHretzmSO4qTziK8M90Be2t1phyoqlk1HjIaN4FdDywIhAOPl4+C65e8rEHdf7xWTQQC7HznDgbPkkB7VVON9tYIJ"}]},"_npmUser":{"name":"xd-js","email":"buxuku@gmail.com"},"directories":{},"maintainers":[{"name":"xd-js","email":"buxuku@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/ai-code-reviewer_1.1.0_1684818194159_0.3363138549823197"},"_hasShrinkwrap":false},"1.2.0":{"name":"@buxuku/ai-code-reviewer","version":"1.2.0","main":"index.js","bin":{"ai-code-reviewer":"bin/index.js"},"scripts":{"start":"tsc --watch","build":"tsc"},"license":"MIT","dependencies":{"@types/axios":"^0.14.0","@types/commander":"^2.12.2","@types/node":"^20.2.1","axios":"^1.4.0","commander":"^10.0.1","typescript":"^5.0.4"},"publishConfig":{"access":"public","registry":"https://registry.npmjs.org/"},"gitHead":"0edd44035b416be105e22f905b3a96c487c81777","_id":"@buxuku/ai-code-reviewer@1.2.0","_nodeVersion":"16.13.0","_npmVersion":"8.1.0","dist":{"integrity":"sha512-MXlKSb9V8jVzBQ4NqPGiDhgkyK1PJiD/XG/2DyTLgRu8jmZvdOFy59OxgB22QjFtFw0sfQXaunzD0VktH3Uw5A==","shasum":"53f22f5e3d6f0ddfce7cb6d577248d62c36095b8","tarball":"https://registry.npmjs.org/@buxuku/ai-code-reviewer/-/ai-code-reviewer-1.2.0.tgz","fileCount":8,"unpackedSize":17211,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIBPH3VErat3HbipcP0ikXf3VhUKqINC9V1zk2GJCddSHAiEAvXKOqTk4K/gj8bvxtP9Kv/ouEUDZKWNjR2vxP+U8/2Q="}]},"_npmUser":{"name":"xd-js","email":"buxuku@gmail.com"},"directories":{},"maintainers":[{"name":"xd-js","email":"buxuku@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/ai-code-reviewer_1.2.0_1684821822806_0.3021153068946867"},"_hasShrinkwrap":false},"1.2.1":{"name":"@buxuku/ai-code-reviewer","version":"1.2.1","main":"index.js","bin":{"ai-code-reviewer":"bin/index.js"},"scripts":{"start":"tsc --watch","build":"tsc"},"license":"MIT","dependencies":{"@types/axios":"^0.14.0","@types/commander":"^2.12.2","@types/node":"^20.2.1","axios":"^1.4.0","commander":"^10.0.1","typescript":"^5.0.4"},"publishConfig":{"access":"public","registry":"https://registry.npmjs.org/"},"description":"## 介绍","licenseText":"MIT License\n\nCopyright (c) 2023  Lin Xiaodong\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all\ncopies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\nSOFTWARE.\n","_id":"@buxuku/ai-code-reviewer@1.2.1","dist":{"shasum":"dd5cd59cef345d83b53c2d8b18565b5d00070d8b","integrity":"sha512-DC+EaQobIp/FR+rOJdRrPLyuDgbJRvwQU2YXrVWvkJuCENqZBVx9epj1di6YEUDNO9TLrPY1Q+ay2VgEPSfKZA==","tarball":"https://registry.npmjs.org/@buxuku/ai-code-reviewer/-/ai-code-reviewer-1.2.1.tgz","fileCount":15,"unpackedSize":26254,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIAhYiWE0sRuVLBsnATjRlBvliEiuaTVFr3J94E9jz8TsAiBECAOMRa41BAxr/zZgxBlVzUUZnfFXtKQ6WxUDiHfkUw=="}]},"_npmUser":{"name":"xd-js","email":"buxuku@gmail.com"},"directories":{},"maintainers":[{"name":"xd-js","email":"buxuku@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/ai-code-reviewer_1.2.1_1685500152755_0.34230222285290846"},"_hasShrinkwrap":false},"1.2.2":{"name":"@buxuku/ai-code-reviewer","version":"1.2.2","main":"index.js","bin":{"ai-code-reviewer":"bin/index.js"},"scripts":{"start":"tsc --watch","build":"tsc"},"license":"MIT","repository":{"type":"git","url":"https://github.com/buxuku/ai-code-reviewer"},"dependencies":{"@types/axios":"^0.14.0","@types/commander":"^2.12.2","@types/node":"^20.2.1","axios":"^1.4.0","commander":"^10.0.1","typescript":"^5.0.4"},"publishConfig":{"access":"public","registry":"https://registry.npmjs.org/"},"description":"## 介绍","licenseText":"MIT License\n\nCopyright (c) 2023  Lin Xiaodong\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all\ncopies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\nSOFTWARE.\n","_id":"@buxuku/ai-code-reviewer@1.2.2","dist":{"shasum":"385769a479fef14ce27b5a70b62cb60e5d838433","integrity":"sha512-kZ8/Q6bmMUUZzuHTj/dk7zWYsYbaxspn+0wbw3Y8WM+dOIHxiDwXYmNN0MC0YJ9sr8AKHF1O9CTuvIsklD36GA==","tarball":"https://registry.npmjs.org/@buxuku/ai-code-reviewer/-/ai-code-reviewer-1.2.2.tgz","fileCount":15,"unpackedSize":26355,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCIpfA2T+Mr4qYhwMAi7zrkx8aEkjRQXTxOrFYTGo074QIhAKVevZpWkDQds0ywaKAMHmFS4cUAvbIAwOyiMs/Yu36S"}]},"_npmUser":{"name":"xd-js","email":"buxuku@gmail.com"},"directories":{},"maintainers":[{"name":"xd-js","email":"buxuku@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/ai-code-reviewer_1.2.2_1685503613230_0.9632955977606772"},"_hasShrinkwrap":false}},"time":{"created":"2023-05-23T04:20:23.955Z","1.0.0":"2023-05-23T04:20:24.177Z","modified":"2023-05-31T03:26:53.501Z","1.1.0":"2023-05-23T05:03:14.340Z","1.2.0":"2023-05-23T06:03:43.021Z","1.2.1":"2023-05-31T02:29:13.016Z","1.2.2":"2023-05-31T03:26:53.386Z"},"maintainers":[{"name":"xd-js","email":"buxuku@gmail.com"}],"license":"MIT","readme":"# @buxuku/ai-code-reviewer\n\n## 介绍\n\n![](preview.png)\n\n`@buxuku/ai-code-reviewer` 是一款应用于 GitLab Merge Request 代码审查的小工具，支持调用私有化部署的 GitLab API，并使用 OpenAI API 获取审查结果。请注意，在使用它时，需要确保符合公司合规要求。😉\n\n\n## 特点\n\n- 🛠️ 支持配置 GitLab API 地址\n- 🌍 支持配置 OpenAI 代理 API 地址，解决国内可能无法访问 OpenAI API 的问题\n- 🆔 支持配置 OpenAI 组织 ID\n- ⚙️ 支持配置多个 OpenAI API Key 实现接口调用的负载均衡（多个 Key 以逗号分隔）\n- 🚦 超过速率限制时，自动等待并重试\n- 💬 审查结果以评论的方式追加到对应的代码块所在位置\n\n\n## 安装\n\n```sh\nnpm i @buxuku/ai-code-reviewer\n`````\n\n## 使用\n\n### 通过 Shell 脚本使用\n\n```shell\nUsage: ai-code-reviewer [options]\n\nOptions:\n  -g, --gitlab-api-url <string>       GitLab API URL (default: \" https://gitlab.com/api/v4\")\n  -t, --gitlab-access-token <string>  GitLab Access Token\n  -o, --openai-api-url <string>       OpenAI API URL (default: \"https://api.openai.com\")\n  -a, --openai-access-token <string>  OpenAI Access Token\n  -p, --project-id <number>           GitLab Project ID\n  -m, --merge-request-id <string>     GitLab Merge Request ID\n  -org, --organization-id <number>    organization ID\n  -h, --help                          display help for command\n```\n\n示例:\n\n```sh\nai-code-reviewer -g https://gitlab.com/api/v4 -t glpat-xxxxxxx -o https://api.openai.com -a skxxxxxxx,skxxxxxxx -p 432288 -m 8\n```\n\n### 在 CI 中使用\n\n在 GitLab CI/CD 中设置 `GITLAB_TOKEN` 和 `CHATGPT_KEY` 变量，`.gitlab-ci.yml` 如下：\n\n```yml\nstages:\n  - merge-request\n\nCode Review:\n  stage: merge-request  \n  image: node:latest\n  script:\n    - npm i @buxuku/ai-code-reviewer -g\n    - ai-code-reviewer -t \"$GITLAB_TOKEN\" -a \"$CHATGPT_KEY\"  -p \"$CI_MERGE_REQUEST_PROJECT_ID\" -m \"$CI_MERGE_REQUEST_IID\"\n  only:\n    - merge_requests\n  when: on_success\n```\n\n## 贡献\n欢迎贡献代码，提出问题和建议！👏\n\n## 许可证\n本项目基于 MIT 许可证。详细信息请参见 LICENSE 文件。📜","readmeFilename":"README.md","description":"## 介绍","repository":{"type":"git","url":"https://github.com/buxuku/ai-code-reviewer"}}