### Example: Install webhook on a single project Source: https://docs.coderabbit.ai/integrations/self-hosted-gitlab Demonstrates how to set environment variables and run the script to install a webhook on a specific GitLab project. ```shell export GITLAB_TOKEN="glpat-xxxxx" ./gitlab-webhook.sh \ -h "gitlab.example.com" \ -u "https://coderabbit.ai/gitlabHandler" \ -s "your-webhook-secret" \ -p 42 ``` -------------------------------- ### Verify CodeRabbit CLI Setup Source: https://docs.coderabbit.ai/cli/skills Use these commands to check the installed CLI version and verify authentication status before filing a skills-related issue. ```bash # Check the installed CLI version coderabbit --version ``` ```bash # Verify authentication status coderabbit auth status ``` -------------------------------- ### Example for Consistent Formatting Source: https://docs.coderabbit.ai/guides/custom-reports This example demonstrates how to use `` and `` tag blocks for consistent report formatting, guiding the content of a summary and listing significant changes. ```text Use the to guide the content of the summary. Use the format shown in but do not include or refer the example's content in the final summary/report. Generate release notes with the following sections: - Summary: A high-level summary of the overall change instead of specific files within 100 words. - Changes: A bullet point list of all the significant changes made in this release. Significant changes include new features, bug fixes, and other notable changes. Use a single sentence for each change without headings or categorization. Do not include changes from PRs that have not been merged. Don't show changes that are too insignificant and don't affect the end-user. Use a single level of bullet points for each change. Don't add links to the PRs. Do not add a list of pull requests. Do not show a random release date, version, etc. if they are not known. ## Summary [Summary of the release] ## Changes - [Summary of the change 1] - [Summary of the change 2] - [Summary of the change 3] - ... - [Summary of the change N] ``` -------------------------------- ### Badge Usage Examples Source: https://docs.coderabbit.ai/finishing-touches/index Examples of how to use the ProPlanBadge, ProPlusPlanBadge, and other platform-specific badges. ```javascript ``` -------------------------------- ### Install WSL Source: https://docs.coderabbit.ai/cli/wsl-windows Run this command in PowerShell or Windows Command Prompt as Administrator to install WSL. It installs Ubuntu by default. Restart your computer when prompted. ```powershell wsl --install ``` -------------------------------- ### Badge Usage Example Source: https://docs.coderabbit.ai/integrations/jira Example demonstrating the usage of AllPlatformsBadge and ProPlanBadge components. ```html | ``` -------------------------------- ### Repository Configuration Example Source: https://docs.coderabbit.ai/configuration Example of a repository-specific .coderabbit.yaml file demonstrating merge behaviors. ```yaml inheritance: true language: "de-DE" reviews: profile: assertive auto_review: drafts: false path_instructions: - path: "src/**" instructions: "Use strict TypeScript settings" - path: "api/**" instructions: "Validate API contracts" ``` -------------------------------- ### Importing Learnings from a File Source: https://docs.coderabbit.ai/guides/learnings Example of how to instruct CodeRabbit to import learnings from a specific file within a repository. ```bash @coderabbitai add a learning using docs/coding-standards.md ``` -------------------------------- ### Pylint Configuration Example Source: https://docs.coderabbit.ai/reference/tools-reference Example configuration for enabling Pylint. ```yaml reviews: tools: pylint: enabled: true ``` -------------------------------- ### Install CodeRabbit CLI via script Source: https://docs.coderabbit.ai/cli/cli-with-self-hosted-CodeRabbit Use this command to download and install the CodeRabbit CLI. Ensure you have a compatible version installed. ```bash curl -fsSL https://cli.coderabbit.ai/install.sh | sh ``` -------------------------------- ### PSScriptAnalyzer Configuration Example Source: https://docs.coderabbit.ai/tools/reference Example configuration for enabling PSScriptAnalyzer. ```yaml reviews: tools: psscriptanalyzer: enabled: true ``` -------------------------------- ### Ruff Configuration Example Source: https://docs.coderabbit.ai/reference/tools-reference Example configuration for enabling Ruff. ```yaml reviews: tools: ruff: enabled: true ``` -------------------------------- ### Installation script Source: https://docs.coderabbit.ai/cli/headless-cli-integration Make the CLI available in the environment using your preferred install method. ```bash curl -fsSL https://cli.coderabbit.ai/install.sh | sh ``` -------------------------------- ### HTMLHint Example Configuration Source: https://docs.coderabbit.ai/reference/tools-reference Example configuration for enabling HTMLHint in the .coderabbit.yaml file. ```yaml reviews: tools: htmlhint: enabled: true ``` -------------------------------- ### Hadolint Configuration Example Source: https://docs.coderabbit.ai/tools/reference Example configuration for enabling Hadolint integration. ```yaml reviews: tools: hadolint: enabled: true ``` -------------------------------- ### Prisma Lint Configuration Example Source: https://docs.coderabbit.ai/tools/reference Example configuration for enabling Prisma Schema linting. ```yaml reviews: tools: prismaLint: enabled: true ``` -------------------------------- ### Reinforcement Rule Example Source: https://docs.coderabbit.ai/guides/learnings Example of a reinforcement rule to prompt the model to review learnings before continuing a review. ```string “Before responding, review all Learnings to ensure none are ignored.” ``` -------------------------------- ### Initiating a Coding Plan in Slack Source: https://docs.coderabbit.ai/slack-agent/plans This example shows how to use the CodeRabbit Agent in Slack to generate a coding plan. It demonstrates the command format and the context the agent uses. ```bash @CodeRabbit Plan adding rate limiting to the public API endpoints based on the approach we discussed above ``` -------------------------------- ### Example YAML Configuration for CodeRabbit Source: https://docs.coderabbit.ai/getting-started/yaml-configuration This is a sample `.coderabbit.yaml` file demonstrating various configuration options for CodeRabbit, including language, review settings, and chat preferences. Place this file in the root of your repository. ```yaml # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json language: "en-US" early_access: false reviews: profile: "chill" request_changes_workflow: false high_level_summary: true poem: true review_status: true review_details: false auto_review: enabled: true drafts: false chat: auto_reply: true ``` -------------------------------- ### Display a quick-reference guide Source: https://docs.coderabbit.ai/guides/commands Post this comment to a pull request to get a quick-reference guide to CodeRabbit's commands and features. ```markdown @coderabbitai help ``` -------------------------------- ### Install webhooks on all projects in a group (including subgroups) Source: https://docs.coderabbit.ai/integrations/self-hosted-gitlab This example demonstrates how to install webhooks on all projects within a specified GitLab group and its subgroups using a shell script. ```shell export GITLAB_TOKEN="glpat-xxxxx" ./gitlab-webhook.sh \ -h "gitlab.example.com" \ -u "https://coderabbit.ai/gitlabHandler" \ -s "your-webhook-secret" \ -g "mygroup/mysubgroup" ``` -------------------------------- ### Global Scope Configuration Source: https://docs.coderabbit.ai/guides/learnings Example configuration for setting the learnings scope to 'global' in the .coderabbit.yaml file. ```yaml knowledge_base: learnings: scope: "global" ``` -------------------------------- ### Local Scope Configuration Source: https://docs.coderabbit.ai/guides/learnings Example configuration for setting the learnings scope to 'local' in the .coderabbit.yaml file. ```yaml knowledge_base: learnings: scope: "local" ``` -------------------------------- ### SwiftLint Example Configuration Source: https://docs.coderabbit.ai/reference/tools-reference SwiftLint integration configuration object. ```yaml reviews: tools: swiftlint: enabled: true config_file: ".swiftlint.yml" ``` -------------------------------- ### Repository Configuration Example Source: https://docs.coderabbit.ai/configuration/configuration-inheritance This is a repository-level configuration file that will be merged with a central configuration. ```yaml inheritance: true language: "de-DE" reviews: profile: assertive auto_review: drafts: false path_instructions: - path: "src/**" instructions: "Use strict TypeScript settings" - path: "api/**" instructions: "Validate API contracts" ``` -------------------------------- ### Configuration file example Source: https://docs.coderabbit.ai/configuration/path-instructions Example of path filters configuration in a .coderabbit.yaml file. ```yaml reviews: path_filters: - "!dist/**" - "!node_modules/**" - "src/**" ``` -------------------------------- ### Get Reviews Metrics Source: https://docs.coderabbit.ai/api-reference/metrics-data-api Example requests for fetching reviews metrics using cURL, Python, JavaScript, and PHP. ```Shell curl --request GET \ --url 'https://api.coderabbit.ai/v1/metrics/reviews?start_date=2026-01-01&end_date=2026-01-20' \ --header 'x-coderabbitai-api-key: ' ``` ```Python import requests url = 'https://api.coderabbit.ai/v1/metrics/reviews' headers = {'x-coderabbitai-api-key': ''} params = {'start_date': '2026-01-01', 'end_date': '2026-01-20'} response = requests.get(url, headers=headers, params=params) print(response.text) ``` ```JavaScript const options = {method: 'GET', headers: {'x-coderabbitai-api-key': ''}}; fetch('https://api.coderabbit.ai/v1/metrics/reviews?start_date=2026-01-01&end_date=2026-01-20', options) .then(res => res.json()) .then(res => console.log(res)) .catch(err => console.error(err)); ``` ```PHP 'https://api.coderabbit.ai/v1/metrics/reviews?start_date=2026-01-01&end_date=2026-01-20', CURLOPT_RETURNTRANSFER => true, CURLOPT_ENCODING => '', CURLOPT_MAXREDIRS => 10, CURLOPT_TIMEOUT => 30, CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1, CURLOPT_CUSTOMREQUEST => 'GET', CURLOPT_HTTPHEADER => [ 'x-coderabbitai-api-key: ' ], ]); $response = curl_exec($curl); $err = curl_error($curl); curl_close($curl); if ($err) { echo 'cURL Error #:' . $err; } ``` -------------------------------- ### Central Configuration Example Source: https://docs.coderabbit.ai/configuration/configuration-inheritance This is a central configuration file that provides default settings for repositories. ```yaml inheritance: true language: "en-US" reviews: profile: chill request_changes_workflow: true high_level_summary: true auto_review: enabled: true drafts: true path_instructions: - path: "src/**" instructions: "Follow our coding standards" - path: "docs/**" instructions: "Check for grammar and clarity" - path: "tests/**" instructions: "Ensure adequate test coverage" chat: art: false ``` -------------------------------- ### Install CodeRabbit CLI via Homebrew Source: https://docs.coderabbit.ai/cli/cli-with-self-hosted-CodeRabbit Install the CodeRabbit CLI using Homebrew. This is an alternative installation method. ```bash brew install coderabbit ``` -------------------------------- ### Profile Configuration Example Source: https://docs.coderabbit.ai/tools/index Example of setting the review profile in .coderabbit.yaml to 'assertive'. ```yaml reviews: profile: assertive ``` -------------------------------- ### Install CodeRabbit CLI Source: https://docs.coderabbit.ai/cli/skills These commands are used to install the CodeRabbit CLI if it's not found on your PATH. After installation, restart your shell. ```bash curl -fsSL https://cli.coderabbit.ai/install.sh | sh ``` ```bash brew install coderabbit ``` -------------------------------- ### Uninstall CodeRabbit CLI (install script) Source: https://docs.coderabbit.ai/cli/index Removes the CodeRabbit CLI if it was installed using the install script. ```bash rm $(which coderabbit) ``` -------------------------------- ### Golangci-lint Configuration Example Source: https://docs.coderabbit.ai/tools/reference Example configuration for enabling and specifying a custom config file for golangci-lint. ```yaml reviews: tools: golangci-lint: enabled: true config_file: ".golangci.yml" ``` -------------------------------- ### Verify CodeRabbit Installation Source: https://docs.coderabbit.ai/cli/wsl-windows Check if the CodeRabbit binary exists in its expected installation directory. ```bash ls -la ~/.coderabbit/bin/coderabbit ``` -------------------------------- ### Example Usage of Badges Source: https://docs.coderabbit.ai/pr-reviews/change-stack Example of how to use the GitHubBadge, ProPlusPlanBadge, and EarlyAccessBadge components. ```jsx | ``` -------------------------------- ### List Users (Go) Source: https://docs.coderabbit.ai/api-reference/users-list This Go program shows how to make a GET request to the users endpoint. Replace `` with your authentication token. ```Go package main import ( "fmt" "net/http" "io" ) func main() { url := "https://api.coderabbit.ai/v1/users?seat_filter=all&role_filter=all&limit=100" req, _ := http.NewRequest("GET", url, nil) req.Header.Add("x-coderabbitai-api-key", "") res, _ := http.DefaultClient.Do(req) defer res.Body.Close() body, _ := io.ReadAll(res.Body) fmt.Println(string(body)) } ``` -------------------------------- ### YAML Configuration Example Source: https://docs.coderabbit.ai/tools/index Example of configuring tools in the .coderabbit.yaml file, including enabling/disabling and specifying config file paths. ```yaml reviews: tools: eslint: enabled: true ruff: enabled: true config_file: "pyproject.toml" ``` -------------------------------- ### actionlint Example Configuration Source: https://docs.coderabbit.ai/reference/tools-reference Example configuration for enabling actionlint, a static checker for GitHub Actions workflow files. ```yaml reviews: tools: actionlint: enabled: true ``` -------------------------------- ### RuboCop Configuration Example Source: https://docs.coderabbit.ai/reference/tools-reference Example configuration for enabling RuboCop. ```yaml reviews: tools: rubocop: enabled: true ``` -------------------------------- ### Regal Configuration Example Source: https://docs.coderabbit.ai/reference/tools-reference Example configuration for enabling Regal. ```yaml reviews: tools: regal: enabled: true ```