> ## Documentation Index
> Fetch the complete documentation index at: https://docs.chronosphere.io/llms.txt
> Use this file to discover all available pages before exploring further.

# Authenticate in Pipeline CLI

To use Pipeline CLI, you must [generate an API token](#generate-an-api-token) to
authenticate with Telemetry Pipeline, and then [set that token](#set-or-switch-an-api-token)
in Pipeline CLI.

<Note>
  API tokens are tied to specific [projects](/ingest/pipeline/administer/project-settings)
  within Telemetry Pipeline, which means only one API token can be active in your
  Pipeline CLI session. To switch between projects, you must
  [switch tokens](#set-or-switch-an-api-token) accordingly.
</Note>

## Generate an API token

Follow these steps to generate an API token in Telemetry Pipeline:

1. Sign in to the [Telemetry Pipeline web interface](https://core.calyptia.com/).
2. Open the project where you want to create a fleet.
3. In the navigation menu, select **<Icon icon="settings" /> Settings**.
4. In the **Generate API key** section, enter a name for your new API key, and then
   click **Generate**.
5. If you have multiple projects in Telemetry Pipeline, repeat these steps for each
   project.

## Set or switch an API token

Only one API token can be active in your Pipeline CLI session. Each API token is
tied to a specific [project](/ingest/pipeline/administer/project-settings), which
means that setting an API token determines which project is active. If you have
multiple Telemetry Pipeline projects, follow these steps to switch between them.

1. Copy the value of the API token you [generated](#generate-an-api-token) for that
   project.
2. Run the following command in Pipeline CLI:

   ```shell /TOKEN/ theme={null}
   calyptia config set_token TOKEN
   ```

   Replace *`TOKEN`* with the value of the API token you copied in the previous step.

### View active project

To view the name of the project associated with your active API token, run the
following command:

```shell theme={null}
calyptia get project
```
