> For the complete documentation index, see [llms.txt](https://docs.aviator.co/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.aviator.co/aviator-cli/how-to-guides/create-a-user-access-token.md).

# How to Create an Access Token

Guide on creating an access token for interacting with GitHub for authentication when using Aviator StackedPRs CLi.

## GitHub Personal Access Token

If [GitHub CLI](https://cli.github.com/) is installed and set up on your computer, av CLI automatically uses the same credential for interacting with GitHub. Alternatively, you can create a personal access token (classic) to authenticate with GitHub on your behalf.

1. Navigate to <https://github.com/settings/tokens/new>.
2. Create a name and expiration for your token.
   * The generated token should have the `repo` scope (all other scopes can be left un-checked).

![Required permissions for the GitHub personal access token that you will use with av](https://273246003-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FOAPqUQVbLbsfI5YESl32%2Fuploads%2FtPADNLxEcN3oc5LpV2VX%2FScreen%20Shot%202022-05-26%20at%2011.20.35%20AM.png?alt=media\&token=b457a698-6c5e-4f16-9c3b-a63888d40e21)

Put the created Personal Access Token in `~/.av/config.yaml`.

<pre class="language-yaml" data-title="~/.av/config.yaml" data-line-numbers><code class="lang-yaml"><strong>github:
</strong>    token: "ghp_abcdefghijklmnop"
</code></pre>

## Aviator User Access Token

User Access Tokens are used to authenticate with the Aviator REST API and Aviator GraphQL API.

1. Navigate to <https://app.aviator.co/settings/personal/api_token>.
2. Create a name and expiration for your token.
   * The token should be in the format `av_uat_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx`. Add it to your Aviator configuration file `~/.av/config.yaml` as shown below.

{% code title="\~/.av/config.yaml" lineNumbers="true" %}

```yaml
aviator:
    apiToken: "av_uat_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"
```

{% endcode %}

You can verify that your token works with `av auth`.

```
$ av auth
Logged in to GitHub as <your_email>.
```


---

# 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 by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.aviator.co/aviator-cli/how-to-guides/create-a-user-access-token.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

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.
