BeeCR API server settings
If you are using BeeCR on-premises (i.e., on your local or virtual machine), you may wish to configure the API server. The BeeCR API server can be configured via environment variables. This documentation section provides an overview of all the environment variables that you may wish to use to control the API server.
⚠️ Note:
The API client may override any of these parameters in the request (via headers and/or query parameters and/or payload and/or configuration file in repository). If the API client passes parameter in the request, it will take precedence over the server's settings.
GitLab host and token
If you intend to use the provided CI/CD components/templates, there is no actual need to redefine GITLAB_HOST
and GITLAB_TOKEN
because the CI/CD components/templates pass them via requests.
Example:
AI model name
On the backend, BeeCR can use AI models via two different APIs: OpenAI and Ollama.
- For OpenAI-compatible APIs use model names as they are,
e.g.
gpt-4o
. - For Ollama-compatible APIs use model names with the prefix
ollama/
, e.g.ollama/codestral:22b
.
Example:
Ollama-compatible API settings
If you are going to use AI models via the Ollama-compatible API, then you may wish to set OPENAI_HOST
.
Otherwise this option is entirely meaningless.
Example:
OpenAI-compatible API settings
If you are going to use AI models via the OpenAI-compatible API, then you may wish to set OPENAI_HOST
and/or OPENAI_API_KEY
.
Otherwise these options are entirely meaningless.
Example:
Review target settings
If you intend to use the provided CI/CD components/templates, there is no actual need to redefine these parameters because the CI/CD components/templates pass them via requests.
Target
TARGET
defines a regex pattern for matching files.
By default, the target regex is \.(py|c|h|cpp|hpp|cs|java|kt|swift|php|go|sh|(j|t)sx?)$
which enables the review for files with the following languages:
- Python:
.py
- C/C++:
.h
,.hpp
,.c
,.cpp
- C#:
.cs
- Java:
.java
- Kotlin:
.kr
- Swift:
.swift
- PHP:
.php
- Go:
.go
- Bash/Shell:
.sh
- JavaScript/Typescript:
.js
,.jsx
,.mjs
,.mjsx
,.ts
,.tsx
However, you can configure it the way you wish to support more languages or vice versa, to suppress some of the defaults.
Example:
Extra target
TARGET_EXTRA
defines an additional regex pattern for matching files.
Useful if you don't want to redefine TARGET
completely.
By default, the TARGET_EXTRA
regex is empty.
Example:
Exclude from target
TARGET_EXCLUDE
defines a regex pattern to exclude files from review
(even if they are matched by TARGET
or TARGET_EXTRA
).
Useful if you don't want to redefine TARGET
.
By default, the TARGET_EXCLUDE
regex is empty.
Example:
Review language
By default, review comments will be produced in English.
If you intend to use the provided CI/CD components/templates, there is no actual need to redefine these parameters because the CI/CD components/templates pass them via requests.
Example:
Repository configuration path
By default, the API server will try to get settings from the ".beecr.yml" file in project's repository root.
Example:
Trigger in notes
If BeeCR integrated via webhooks for "Comment" events then it will review the changes in MR if the special trigger-word has been mentioned in the note.
By default, the review process will trigger by /beecr
.
Example: