# CLI authentication

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