---
title: Connect your repository
question: How do I connect my GitLab or GitHub repository to Diavi?
description: Sign in with your forge, give the space its access to the repositories, and pick the repository Diavi will work on.
section: start
order: 1
---
Click **Continue with GitLab** or **Continue with GitHub**: your forge proves who you are, with no password to create. Access to the repositories goes through the space's token, which the owner installs once; every member then works with it, without supplying their own.

## How do I sign in?

- **With your forge** (recommended): one click, and GitLab or GitHub confirms your identity. For a self-hosted GitLab instance, open the optional field and enter its URL, in `https://`.
- **With an email and a password**: set them in **Preferences → Sign-in and security**, once signed in with your forge. Handy where the forge is not open to everyone.
- **With a personal token**: only when your instance has not declared a sign-in application yet. It proves your identity once, then it is not kept.

## What scopes does the space's token need?

The minimum to read an issue, clone the repository and open a merge request.

- **GitLab**: the `api` and `read_user` scopes.
- **GitHub**: the `repo` scope.

It is installed in **Preferences → Forge**. It is checked against your forge before being saved: if it has expired or lacks a scope, you know straight away rather than at the first failed run.

## Can anyone read the token back?

No, and that is deliberate. It is encrypted in the database and no screen shows it again — neither yours nor Diavi's console. If you lose it, you generate a new one on your forge and replace it; there is no recovery, only replacement. Diavi warns you when it nears the age you set, and as soon as the forge refuses it.

## What if the person who set the token leaves?

With a personal token, the space depends on that person: if they leave the team or their token expires, runs stop. On GitLab, set a **group access token** (or a project one) instead: it acts as a bot that belongs to no one, and Diavi recognises it on its own — the screen shows "Token of the bot". On GitHub, install the **Diavi application** on your organisation from **Preferences → Forge**, when it is offered: its token renews itself. Members' sign-ins never replace either.

## What next?

Once signed in, Diavi sees the projects the space's token can reach. You pick the one to run on when you launch — nothing is locked to a single repository.
