
Security News
ECMAScript 2025 Finalized with Iterator Helpers, Set Methods, RegExp.escape, and More
ECMAScript 2025 introduces Iterator Helpers, Set methods, JSON modules, and more in its latest spec update approved by Ecma in June 2025.
code-review-gpt-gitlab
Advanced tools
Your AI code reviewer. Improve code quality and catch bugs before you break production
Code Review GPT is a NodeJS package that uses LLMs to provide feedback on code. It is designed to be used in a CI environment to provide feedback on pull requests.
In the root of your git repository run:
npm install code-review-gpt
npx code-review-gpt configure --setupTarget=github
If you are running this tool in Gitlab, you will need to do some additional setup. You will need to create a access token in Gitlab and store it in your CI/CD variables to allow the bot access to you Gitlab account. Follow the steps below.
CODE_REVIEW-GPT-TOKEN
. Set the scope to be api
only.Navigate to the project where you want to add the code review bot.
In the left sidebar, click the Settings drop down, then click CI/CD
Scroll down to the Variables section and click the Expand button.This is where you can manage your CI/CD variables.
Create a new variable by clicking the Add Variable button in the CI/CD Variable table.
Paste your previously copied access token into the Value box. Name the variable GITLAB_TOKEN
. Under the Flags section, make sure to tick the Mask variable
option.
Protect variable
if your branches are not protected, otherwise this variable won't be availiable for the bot to use.]If you are using gitlab self hosted define also GITLAB_URL
variable
Save you changes. Now you can go ahead and run the following commands in you project directory.
npm install code-review-gpt
npx code-review-gpt configure --setupTarget=gitlab
See templates for example yaml files. Copy and paste them to perform a manual setup.
Code Review GPT works locally to review files staged for commit:
Run npm i code-review-gpt && npx code-review-gpt review
in the root directory of a git repository.
Run npm i -g code-review-gpt
to install the tool globally.
You can now run code-review-gpt review
in the root directory of any git-enabled repository on your machine.
code-review-gpt review
- Runs the code review on the staged files.
code-review-gpt configure
- Runs a setup tool to configure the application.
code-review-gpt test
- Runs the e2e testing suite used internally in the CI in the tool repo.
--ci
- Used with the review
command. Options are --ci=("github" | "gitlab"). Defaults to "github" if no option is specified. Runs the application in CI mode. This will use the BASE_SHA and GITHUB_SHA environment variables to determine which files to review. It will also use the GITHUB_TOKEN environment variable to create a comment on the pull request with the review results.
--reviewType
- Used with the 'review' command. The options are --reviewType=("changed" | "full" | "costOptimized). Defaults to "changed" if no option is specified. Specifies whether the review is for the full file or just the changed lines. costOptimized limits the context surrounding the changed lines to 5 lines.
--remote
- Used with the 'review' command. Usage --remote=mattzcarey/code-review-gpt#96
. Review a remote GitHub Pull Request.
--commentPerFile
- Used when the --ci
flag is set. Defaults to false. It enables the bot to comment the feedback on a file-by-file basis.
--setupTarget
- Used with the configure
command. Options are --setupTarget=("github" | "gitlab"). Defaults to "github" if no option is specified. Specifies for which platform ('github' or 'gitlab') the project should be configured for.
--model
- The model to use for the review. Defaults to gpt-4
. You can use any openai model you have access to.
--debug
- Runs the application in debug mode. This will enable debug logging.
--org
- The organization id to be used for OpenAI. This should only be used if you are member of multiple organisations and want to use your non default org.
FAQs
Your AI code reviewer. Improve code quality and catch bugs before you break production
The npm package code-review-gpt-gitlab receives a total of 6 weekly downloads. As such, code-review-gpt-gitlab popularity was classified as not popular.
We found that code-review-gpt-gitlab demonstrated a not healthy version release cadence and project activity because the last version was released 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
ECMAScript 2025 introduces Iterator Helpers, Set methods, JSON modules, and more in its latest spec update approved by Ecma in June 2025.
Security News
A new Node.js homepage button linking to paid support for EOL versions has sparked a heated discussion among contributors and the wider community.
Research
North Korean threat actors linked to the Contagious Interview campaign return with 35 new malicious npm packages using a stealthy multi-stage malware loader.