coderabbit, and repositories override it by adding their own file. This page also covers two other ways to share configuration: remote_config and TypeScript fragments.
How central configuration works
A.coderabbit.yaml or .coderabbit.config.ts in the coderabbit repository applies to every repository that has no configuration file of its own. Its layer is Central YAML. When a repository adds its own file, CodeRabbit uses that file instead, unless inheritance merges the two. The central file must use schema V2. CodeRabbit ignores a central file with version: 3 and shows a warning. If a repositoryâs file turns on inheritance, the review fails instead.
Central configuration outranks Repository settings saved in the web interface. CodeRabbit reads the web interface settings only when no valid central file exists, or when the central file turns on inheritance. If the central file is invalid, CodeRabbit ignores it and adds a warning to the summary.
Central configuration shares settings. It doesnât share guideline file content from another repository. That is a separate mechanism under Code guidelines.
Set up a central repository
1
Create the repository
Create a repository named exactly
coderabbit. See the table below for where it lives on your platform.2
Add the file
Add
.coderabbit.yaml or .coderabbit.config.ts at the root of the default branch. If both a YAML file and a TypeScript file exist, the YAML file is used.3
Install CodeRabbit on it
Install CodeRabbit on the
coderabbit repository itself. CodeRabbit canât read the file otherwise.4
Check the result
Open a pull request in a repository that has no file of its own and comment
@coderabbitai configuration. The source line names the file from the coderabbit repository. See Check which configuration a review used.Example: a central file and a repository override
- Central file
- Repository override
.coderabbit.yaml in the coderabbit repository
assertive profile, no draft reviews, and defaults for every other key. For example, unless a global override sets it, chat.art is back to its default, true, although the central file turns it off. To keep the central values a repository doesnât set, add inheritance: true to the repository file. See Inheritance and merging.
Name the repository for your platform
Use central configuration in GitLab groups
For each project, CodeRabbit looks for acoderabbit project from the innermost namespace outward. It uses the first one that contains a configuration file. A closer coderabbit project without a file is skipped.
For company/team-a/subteam/project1, CodeRabbit tries the three coderabbit projects in this order and stops at the first one with a file. CodeRabbit never merges two central files. Install CodeRabbit on the top-level group so it can read the coderabbit project at every level.
Share TypeScript fragments
A repository that uses TypeScript configuration can pull a fragment from thecoderabbit repository and combine it with its own settings instead of replacing central configuration.
.coderabbit.config.ts
includeRemote reads the coderabbit repository when you omit repo. The repository can be private, and fragments can be .ts or .yaml. A fragment from another repository follows the same access rules as remote_config.
Reference a shared file with remote_config
remote_config redirects a repository to a configuration file in another repository, or at a public URL. Use it when one teamâs repositories share a file but you donât want a central repository for the whole organization.
- GitHub
- GitLab
- URL
.coderabbit.yaml
- Only key. The file must contain nothing but
remote_config. With any other key, CodeRabbit doesnât follow the redirect and reads the file as ordinary configuration. - Replace, not merge. The fetched file replaces your file entirely. It becomes the repository-file layer and can use
inheritance. It canât contain its ownremote_config. - YAML in the repository only. Central YAML and TypeScript configuration donât support
remote_config. In TypeScript, useincludeRemote. - Repository form.
refdefaults tomain. A bare repository name resolves under the reviewed repositoryâs owner. See Who can read a shared repository. - URL form. HTTPS only. CodeRabbit fetches it without authentication, with a five-second timeout and no redirects.
Who can read a shared repository
These rules apply to bothremote_config and includeRemote. The shared repository must have the same owner as the reviewed repository, except on GitLab, where any namespace the CodeRabbit connection can read works. The CodeRabbit installation must be able to read it.
For configuration read from a pull request branch, the pull request author and the person who started the review must both be able to read the shared repository. If CodeRabbit canât confirm that, the configuration fails, and CodeRabbit doesnât fall back to defaults. This check doesnât apply to the reviewed repository or the coderabbit repository.
Whatâs next
Inheritance and merging
Merge central settings with a repositoryâs own.
Apply to every repository
Choose between central, web, and workspace defaults.
TypeScript configuration
Build shared fragments in code.