> For the complete documentation index, see [llms.txt](https://argos-ci.com/docs/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://argos-ci.com/docs/learn/integrations/gitlab-integration.md).

# GitLab integration

Connect Argos to GitLab to get commit statuses on your merge requests and accurate baseline selection from your commit history.

Argos reads commit history to select the correct [baseline build](/docs/learn/platform-fundamentals/baseline-build.md) and reports statuses back to GitLab. The integration also lets you sign in with GitLab and import your GitLab repositories.

### Connect a GitLab repository

Argos communicates with GitLab through a Personal Access Token, acting as a dedicated bot user on your merge requests.

{% stepper %}
{% step %}

#### Generate a Personal Access Token in GitLab

1. Go to [GitLab tokens settings](https://gitlab.com/-/profile/personal_access_tokens?name=argos2\&scopes=api,read_user).
2. Select **Add new token**.
3. Set an expiration date 12 months ahead (the maximum allowed).
4. Select **Create personal access token** and copy the generated token.

![Generate a Personal Access Token in GitLab](/files/77e46b7b227ebe26ff1c3a9856999cba6a01c709)

{% hint style="info" %}
You can also use a [Project Access Token](https://docs.gitlab.com/ee/user/project/settings/project_access_tokens.html) if you want to restrict access to a single project. If you choose this option, be sure to set the role of the token to **Developer**.
{% endhint %}
{% endstep %}

{% step %}

#### Configure the token in Argos

1. From the dashboard, select your team or your personal account from the scope selector.
2. Select the **Settings** tab and go to the **Integrations** section.
3. Scroll to the **GitLab** section.
4. Enter the generated token and select **Save**.

![Configure GitLab in Argos](/files/b70b5aaa3463a14ad12d259ce58ec07d7e9ee72c)
{% endstep %}

{% step %}

#### Link a GitLab project to Argos

1. From the dashboard, select your team or your personal account from the scope selector.
2. Select the **Projects** tab.
3. Select **Create a new Project** at the top right.
4. Select **Continue with GitLab**.
5. Pick your GitLab organization and the desired repository. The new project appears in your projects list.

![Configure GitLab in Argos](/files/d14da22355b95096636c09a0f07792148dbf088d)
{% endstep %}
{% endstepper %}

### Connect an existing Argos project to GitLab

To link a GitLab repository to a project that already exists in Argos, go to **Project Settings → Connect Git Repository** and select the repository. The [token](#connect-a-gitlab-repository) must be configured first.

### GitLab Self-Managed

GitLab Self-Managed deployments are supported on the Argos Enterprise plan. These setups often require tailored configuration alongside SAML SSO and other enterprise features. To discuss enabling GitLab Self-Managed, [contact sales](https://argos-ci.com/contact).


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://argos-ci.com/docs/learn/integrations/gitlab-integration.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
