> For the complete documentation index, see [llms.txt](https://docs.terrakube.io/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.terrakube.io/2.20.0/user-guide/vcs-providers/github.com.md).

# Github

For using repositories from GitHub.com with Terrakube workspaces and modules you will need to follow these steps:

{% hint style="info" %}
**Manage VCS Providers** permission is required to perform this action, please check [Team Management](/2.20.0/user-guide/organizations/team-management.md) for more info.
{% endhint %}

Navigate to the desired organization and click the **Settings** button, then on the left menu select **VCS Providers**

<figure><img src="https://2695156030-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FiAistJ55LNNLsrfZftuX%2Fuploads%2Fgit-blob-014b437189fd580494cb401e7ebf8663972010c0%2Fimage%20(308).png?alt=media" alt=""><figcaption></figcaption></figure>

{% hint style="info" %}
If you prefer, you can add a new VCS Provider directly from the [Create workspace](/2.20.0/user-guide/workspaces/creating-workspaces.md) or Create Module screen.
{% endhint %}

Click the **Github button** and then click the **Github Cloud option.**

<figure><img src="https://2695156030-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FiAistJ55LNNLsrfZftuX%2Fuploads%2Fgit-blob-91cedc204695ea010fc1609d6e9dfc6b9a2ec81e%2Fimage%20(356).png?alt=media" alt=""><figcaption></figcaption></figure>

In the next screen click the link to [register a new OAuth Application](https://github.com/settings/applications/new) in Github

<figure><img src="https://2695156030-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FiAistJ55LNNLsrfZftuX%2Fuploads%2Fgit-blob-2f6fb80776ef014205c51844e193cc9718fbcac2%2Fimage%20(238).png?alt=media" alt=""><figcaption></figcaption></figure>

In the Github page, complete the required fields and click **Register application**

<table><thead><tr><th width="354">Field</th><th>Description</th></tr></thead><tbody><tr><td>Application Name</td><td>Your application name, for example you can use your organization name.</td></tr><tr><td>Homepage URL</td><td>The url for your application or website,</td></tr><tr><td>Application Description</td><td>Any description you choice</td></tr><tr><td>Authorization Callback URL</td><td>Copy the callback url from the Terrakube UI</td></tr></tbody></table>

{% hint style="info" %}
You can complete the fields using the information suggested by terrakube in the VCS provider screen
{% endhint %}

<figure><img src="https://2695156030-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FiAistJ55LNNLsrfZftuX%2Fuploads%2Fgit-blob-f55d12d22b3aa4c2efc91051945519f3c4a00760%2Fimage%20(142).png?alt=media" alt=""><figcaption></figcaption></figure>

Next, generate a new client secret

<figure><img src="https://2695156030-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FiAistJ55LNNLsrfZftuX%2Fuploads%2Fgit-blob-248b66e3de52419592bb611a0a9b2b0c3b94affa%2Fimage%20(318).png?alt=media" alt=""><figcaption></figcaption></figure>

Copy the **Client Id** and **Client Secret** from Github and go back to Terrakube to complete the required information. Then, click the **Connect and Continue** button

<figure><img src="https://2695156030-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FiAistJ55LNNLsrfZftuX%2Fuploads%2Fgit-blob-da8da9c03660cf8281ea7d214b6eaf660949c2bc%2Fimage%20(237).png?alt=media" alt=""><figcaption></figcaption></figure>

You will see the Github page, click the **Authorize** button to complete the connection

<figure><img src="https://2695156030-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FiAistJ55LNNLsrfZftuX%2Fuploads%2Fgit-blob-9002c3336fa1a828b21bd19d199e15e89a436ba6%2Fimage%20(341).png?alt=media" alt=""><figcaption></figcaption></figure>

Finally, if the connection was established successfully, you will be redirected to the VCS provider’s page in your organization. You should see the connection status with the date and the user that created the connection.

<figure><img src="https://2695156030-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FiAistJ55LNNLsrfZftuX%2Fuploads%2Fgit-blob-727a308a6eb89cf17d5d2c200e01a9cd5e421354%2Fimage%20(98).png?alt=media" alt=""><figcaption></figcaption></figure>

And now, you will be able to use the connection in your workspaces and modules:

<figure><img src="https://2695156030-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FiAistJ55LNNLsrfZftuX%2Fuploads%2Fgit-blob-de02406f9df7dcbaf7fe9e658fe90e52f261515a%2Fimage%20(56).png?alt=media" alt=""><figcaption></figcaption></figure>


---

# 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://docs.terrakube.io/2.20.0/user-guide/vcs-providers/github.com.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.
