> For the complete documentation index, see [llms.txt](https://docs.tensorleap.ai/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.tensorleap.ai/getting-started/tensorleap-setup/cli-authentication.md).

# CLI authentication

This page covers the steps needed to authenticate the CLI with your server

In order to allow the [CLI installed on your local station](/getting-started/tensorleap-setup/installation.md#tensorleap-client) to access your local server you need to supply the CLI with an authentication token.&#x20;

We have several ways to obtain the authentication token:

{% tabs %}
{% tab title="CLI" %}
To authenticate via the CLI:

1. Run `leap auth login`&#x20;
2. When asked for the API URL enter the url you use to access the Tensorleap Platform (hit Enter to chose default)
3. Press Enter for the rest of the interactive questions. This should open your browser
4. The browser should ask you to "Authorize" the CLI to access your server. Click it to complete the authentication.

{% hint style="info" %}
If you are not currently logged in to the system, you would be required to login after opening the browser and before the authentication screen shows
{% endhint %}
{% endtab %}

{% tab title="UI" %}
To authenticate via the UI:

1. Go into the Tensorleap app via the browser (default URL: <http://localhost:4589/>)
2. Login with the credentials you've entered [after registering](/getting-started/tensorleap-setup/registering-a-user.md).
3. Open up the menu from the top left corner and choose "CLI Token"

{% hint style="info" %}
Creating a CLI token disable any previous ones. Therefore, you might be prompted to approve the creation of the a token.
{% endhint %}

4. Copy the  CLI command that appears in the UI and paste into your terminal.
   {% endtab %}
   {% endtabs %}


---

# 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.tensorleap.ai/getting-started/tensorleap-setup/cli-authentication.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.
