# GitLab
URL: https://docs.clearly-ai.com/docs/integrations/code/gitlab
Description: Connect Clearly AI to GitLab.
## Overview [#overview]

Connect GitLab to Clearly AI so Clearly AI can use your repositories as project context and review the code in those repositories.

The GitLab integration uses **Shared API Token** authentication: a GitLab personal access token.

For background on authentication choices across integrations, see [Integrations](https://docs.clearly-ai.com/docs/integrations).

## Instructions [#instructions]

### Prerequisites [#prerequisites]

* Access to **Integrations** in **Organization settings**
* A GitLab account that can access the repositories you want Clearly AI to review
* A GitLab personal access token with access to the repositories Clearly AI should read

<Steps>
  <Step>
    ### Open the GitLab integration [#open-the-gitlab-integration]

    In Clearly AI, open **Organization settings**, select **Integrations**, then click **Set up** on the GitLab card.
  </Step>

  <Step>
    ### Enter the GitLab instance URL [#enter-the-gitlab-instance-url]

    If you use GitLab.com, leave **Instance URL** empty.

    If you use a self-managed GitLab instance, enter the base URL for that instance, such as `https://gitlab.example.com`.
  </Step>

  <Step>
    ### Enter your token [#enter-your-token]

    Under **Authentication**, in **Shared API Token**, paste your GitLab personal access token.
  </Step>

  <Step>
    ### Add the credential [#add-the-credential]

    Check **I understand** under the shared-credential notice, then click **Add workspace credential**. Clearly AI tests the credential and enables the integration only when the test passes. Projects can then add GitLab repositories as sources. The repositories Clearly AI can review depend on the access granted to your token.
  </Step>
</Steps>

## FAQs [#faqs]

<Accordions>
  <Accordion title="Why does Add workspace credential fail?">
    Confirm the personal access token is still active and has access to the repositories Clearly AI needs to read.
  </Accordion>

  <Accordion title="Why does a GitLab.com connection fail with an instance URL set?">
    Remove the **Instance URL** value unless you are connecting to a self-managed GitLab instance.
  </Accordion>

  <Accordion title="Why are some repositories missing?">
    Confirm the GitLab account tied to the token can access those repositories.
  </Accordion>
</Accordions>

## Related [#related]

* [Integrations](https://docs.clearly-ai.com/docs/integrations) - Choose an authentication method for an integration
* [GitHub](https://docs.clearly-ai.com/docs/integrations/code/github) - Connect Clearly AI to GitHub using a Shared API Token or OAuth 2.0
* [Concepts](https://docs.clearly-ai.com/docs/concepts) - Learn how integrations provide project context in Clearly AI