> ## Documentation Index
> Fetch the complete documentation index at: https://docs.gleap.io/llms.txt
> Use this file to discover all available pages before exploring further.

# Repositories

> Connect the code Kai Code reads and opens pull requests in.

Kai Code works inside your repositories: it reads the code to investigate a ticket and opens pull requests against the branch you choose. Repositories are configured per project under **Kai Code → Settings → Repositories**.

## Supported providers

* **GitHub** — connected through the Gleap GitHub App. You choose which organisations and repositories the app may access during the install.
* **Azure DevOps**, **GitLab** and **Bitbucket** — connected through OAuth with your account.

A provider is connected once per project. Disconnecting a provider is only possible after every repository from it has been removed.

## Add a repository

1. Open **Kai Code → Settings → Repositories** and choose **Add repository**.
2. Pick the provider. If it is not connected yet, **Connect** takes you through its authorization first and brings you back.
3. Pick the repository from the list. Repositories that are already in the project are hidden; use the search to narrow long lists.
4. Set the **Default branch** — the branch Kai starts sessions from and opens pull requests against — and, optionally, a **Description**.
5. Choose **Add repository**.

<Tip>
  The description is read by Kai before it starts working in the repository. A sentence or two about the stack, conventions and the API client it should use noticeably improves first attempts, e.g. "React SPA dashboard — TypeScript, MobX, SCSS. Uses a TSOA-generated API client."
</Tip>

## Edit a repository

Open a repository's menu and choose **Edit** to change its default branch, its description and its **excluded paths**. Excluded paths use gitignore syntax and keep generated or vendored folders out of Kai's view, which makes sessions faster and cheaper.

## Preview setup

For web repositories Kai can set up a **preview**: a running instance of your app that it uses to verify a change visually. The status is shown on the repository row.

* **Set up preview** starts a guided session in which Kai learns how to install, build and start your app. It writes the result to `.gleap/dev.yaml` and opens a small config-only pull request; merge it so future sessions skip the setup. Answer Kai's questions when the row shows **Needs your input**.
* Once the row shows **Preview verified**, sessions in this repository can run [Kai Verify](/documentation/kai-code/sessions#kai-verify) with screenshots and video proof. **Preview failing** offers **Fix with Kai**.
* Preview setup and previews run on a paired [Kai Code Bridge](/documentation/guides/kai-code-bridge) machine, so pair one first.

## Remove a repository

Open the row's menu and choose **Remove**. The repository itself and its code stay with your provider; existing sessions keep their history.
