# Add a project to CodeScan from GitLab

This document guides you through how to add a GitLab project to your CodeScan Cloud account and run the analysis.

1. Log in to your CodeScan account.
2. Once you log in to your [CodeScan](https://www.codescan.io/) account, click on the (**+**) icon in the top-right corner and select **Analyze new project**.

<figure><img src="/files/W5o21hnoK9Aavp4fJD26" alt=""><figcaption></figcaption></figure>

3. This takes you to a different window. Choose the **Organization** for which you'd like to create a project. Click on **Set Up**.

<figure><img src="/files/SIy566RIBJcMBPr9rLDO" alt="" width="563"><figcaption></figcaption></figure>

4. On the next screen, click on **Add Analysis Project** button.

<figure><img src="/files/to4rX1ZBGrPNYp7iZcxd" alt=""><figcaption></figcaption></figure>

5. You will now see a new popup window; click on [**GitLab**](https://knowledgebase.autorabit.com/codescan/docs/integrating-codescan-in-gitlab) from the given options.

<figure><img src="/files/Cx81rBYa1j3XWvub2knC" alt=""><figcaption></figcaption></figure>

6. Now another popup window appears with the fields: **Choose a repository**, **Project Branch**, **Check Pull Requests**, **Key**, and **Name.**

<figure><img src="/files/bTJhwiq0vWLQVShFf77Q" alt="" width="375"><figcaption></figcaption></figure>

* Choose the repository you want to add, followed by the project branch name.
* Make sure you select the checkbox under **Check Pull Requests**. This will add **webhooks**.
* Next, enter the **Project Key** followed by the **Project Name**.
* Once you fill out all the details in the popup window, click on **Add and Run Now**.

{% hint style="info" %}
**Note:** To find the project key, refer to our document [HERE](https://knowledgebase.autorabit.com/codescan/docs/finding-your-project-key).
{% endhint %}

7. This triggers the project analysis and the project being added under your CodeScan organization.
8. You can view the project analysis report by clicking on **CodeScan** from your VC repository.

<figure><img src="/files/cW9VdDEWfGQeuynVHoor" alt=""><figcaption></figcaption></figure>

9. When you click the link, it will take you to the **CodeScan Project** page, where you can view your project analysis report.

<figure><img src="/files/2LiWHI2JDFYOtbnqjsEr" alt=""><figcaption></figcaption></figure>

Now that the webhooks have been created, every time a push or pull request is made to the tracked branch, an analysis will be triggered in CodeScan.


---

# Agent Instructions: 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:

```
GET https://knowledgebase.autorabit.com/product-guides/codescan/getting-started/using-codescan/adding-projects-to-codescan/adding-a-project-to-codescan-from-gitlab.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
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.
