# Connecting a repository

Connect a GitHub repository to your project to make its code available to the AI chat and to
mirror documentation from the repo. GitHub is supported today.

## Creating an access token

1. Create a **fine-grained Personal Access Token (PAT)** on GitHub.
2. Grant it access to exactly the repository you want.
3. Give it only the **Contents: Read** permission — Lalabase needs nothing more.

## Connecting the repository

1. Open the **project settings** and click **Connect repository** in the **Chat with your code** or **Show documentation** card.
2. Enter the name as `owner/name`, e.g. `acme/backend`.
3. Paste the Personal Access Token and confirm with **Connect**.
4. Lalabase validates the token against GitHub and then starts indexing automatically.

<div class="docs-callout docs-callout--tip">
  <div class="docs-callout__title">Token expired?</div>
  <p>When a PAT expires, add a new one via "Update access token" — the existing index is preserved. For automatic updates on every push, optionally set up a webhook.</p>
</div>

## What's next

Once the repository is indexed, you can [use code context in the AI chat](https://lalabase.com/docs/en/guides/repositories/use-in-chat) or
[write and sync documentation locally](https://lalabase.com/docs/en/guides/documentation/write-and-sync).
