Install/run via CLI
CLI mode is best suited for immediate, one-time code reviews.
Prerequisites: Before proceeding, ensure you've completed all necessary prerequisites for self-hosted AI Code Review Agent.
Start Docker: Ensure Docker is running on your machine.
Repository Download: Download the AI Code Review Agent GitHub repository to your machine.
Extract and Navigate:
Extract the downloaded .zip file to a preferred location.
Navigate to the extracted folder and then to the “cra-scripts” subfolder.
Note the full path to the “cra-scripts” folder for later use.
Open Command Line:
Use Bash for Linux and macOS.
Use PowerShell for Windows.
Set Directory:
Change the current directory in Bash/PowerShell to the “cra-scripts” folder.
Example command:
cd [Path to cra-scripts folder]
Adjust the path based on your extraction location.
Configure Properties:
Open the bito-cra.properties file in a text editor from the “cra-scripts” folder.
Set mandatory properties:
mode = cli
pr_url
bito_cli.bito.access_key
git.provider
git.access_token
Optional properties (can be skipped or set as needed):
code_feedback
static_analysis
dependency_check
dependency_check.snyk_auth_token
Note: Detailed information for each property is provided on Agent Configuration: bito-cra.properties File page.
Check the Required Access Tokens guide to learn more about creating the access tokens needed to configure the Agent.
Run the Agent:
On Linux/macOS in Bash: Run
./bito-cra.sh bito-cra.properties
On Windows in PowerShell: Run
./bito-cra.ps1 bito-cra.properties
This step might take time initially as it pulls the Docker image and performs the code review.
Final Steps:
The script may prompt values of mandatory/optional properties if they are not preconfigured.
Upon completion, a code review comment is automatically posted on the Pull Request specified in the pr_url property.
Last updated