Install/run via CLI

CLI mode is best suited for immediate, one-time code reviews.

  1. Prerequisites: Before proceeding, ensure you've completed all necessary prerequisites for self-hosted AI Code Review Agent.

  2. Start Docker: Ensure Docker is running on your machine.

  3. Repository Download: Download the AI Code Review Agent GitHub repository to your machine.

  4. 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.

  1. Open Command Line:

    • Use Bash for Linux and macOS.

    • Use PowerShell for Windows.

  2. 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.

  1. Configure Properties:

    • Open the file in a text editor from the “cra-scripts” folder. Detailed information for each property is provided on Agent Configuration: File page.

    • 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):

      • git.domain

      • code_feedback

      • static_analysis

      • dependency_check

      • dependency_check.snyk_auth_token

      • review_scope

      • exclude_branches

      • exclude_files

      • exclude_draft_pr

Note: Detailed information for each property is provided on Agent Configuration: File page.

Check the Required Access Tokens guide to learn more about creating the access tokens needed to configure the Agent.

  1. Run the Agent:

    • On Linux/macOS in Bash: Run ./

    • On Windows in PowerShell: Run ./bito-cra.ps1

This step might take time initially as it pulls the Docker image and performs the code review.

  1. 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.

Note: To improve efficiency, the AI Code Review Agent is disabled by default for pull requests involving the "main" branch. This prevents unnecessary processing and token usage, as changes to the "main" branch are typically already reviewed in release or feature branches. To change this default behavior and include the "main" branch, please contact support.

Last updated


Bito Inc. (c) 2024