---
title: "Repositories"
description: "Connect the code Kai Code reads and opens pull requests in."
url: https://docs.gleap.ai/en/articles/693-repositories
collection: "Kai Code"
updated: 2026-11-01
language: en
---

# 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 **AI agents → 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.
    

The current shared setup uses the GitHub connection once per project. Older Azure DevOps, GitLab and Bitbucket connections can retain provider-specific Add repository and Edit screens. Review connected repositories before disconnecting a provider.

## Add a repository

1.  Open AI agents → Kai Code → Settings → Repositories and choose Add repositories.
    
2.  If GitHub is not connected, connect it and grant access to the repositories Kai needs.
    
3.  Search for and select the repositories to add for coding work.
    
4.  Open each repository and review its branch, description, access, Used by settings and preview status.
    

> **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."

## Edit a repository

Open the shared repository page from the repository list, Knowledge → Code repositories, or Settings → Apps → GitHub. Review its branch and description, and use What Kai reads → Hidden from Kai for excluded paths. Used by shows which agents can use it. Older provider screens can instead offer Edit → Excluded paths.

## 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](https://gleap-developer-docs.gleap.help/en/articles/690-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](https://gleap-developer-docs.gleap.help/en/articles/697-kai-code-bridge) machine, so pair one first.
    

## Remove a repository

To stop Kai Code using a shared repository, review its Used by settings and turn off Kai Code, or use Remove from Kai Code where offered. The repository stays with your provider. Review the other agents before disconnecting a shared repository entirely.

## Related

- [Kai Code](https://docs.gleap.ai/en/articles/688-kai-code.md)
- [Getting started](https://docs.gleap.ai/en/articles/689-getting-started.md)
- [Sessions](https://docs.gleap.ai/en/articles/690-sessions.md)
- [Tickets and pull requests](https://docs.gleap.ai/en/articles/691-tickets-and-pull-requests.md)
- [Your own coding agent](https://docs.gleap.ai/en/articles/692-your-own-coding-agent.md)
