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

# Authenticate

> Log in with a browser, run the CLI in CI and from agents, switch between accounts, and log out.

`plivo login` is the only way to sign in. It opens a browser, then saves a named **profile** you can switch between. Since CLI v1.1.2 the CLI no longer reads credentials from the environment, so CI jobs and coding agents use a profile created by an earlier login.

## Log in with a browser

Connect the CLI to your Plivo account with a browser-based login flow. The CLI opens the Plivo Console in your default browser; you sign in there and approve access. Your password never touches the CLI.

After approval, the CLI stores a profile in `~/.plivo/config.toml` and keeps the auth token in your operating system's secure credential store (Keychain on macOS, Credential Manager on Windows, Secret Service on Linux).

Use [`plivo auth list`](/docs/cli/authenticate#switch-between-accounts) to see saved profiles and `plivo auth use` to switch between them. To remove a profile and its stored token, use [`plivo logout`](/docs/cli/authenticate#log-out).

<Note>
  Running in CI, a container, or an AI coding agent? There is no headless login — see [Run in CI and from agents](/docs/cli/authenticate#run-in-ci-and-from-agents).
</Note>

**Command:** `plivo login`

**Flags**

* `-n, --name <profile>`: name to save the profile under (default `default`).
* `--no-verify`: skip the validation request to `GET /Account/` after login (offline or mock use only).

**Examples**

```bash theme={null}
plivo login
plivo login --name staging
```

## Run in CI and from agents

`plivo login` needs a browser, and since CLI v1.1.2 it is the only way a credential enters the CLI. `PLIVO_AUTH_ID` and `PLIVO_AUTH_TOKEN` are no longer read from the environment, so there is no headless login.

For a CI pipeline, a container, or an AI coding agent, run `plivo login` once on the machine that will run the commands. Every later command uses the stored profile. Provision the runner or build the image with that profile already in place, and confirm it with `plivo auth whoami`.

```bash theme={null}
plivo auth whoami
```

<Warning>
  A saved profile grants access to your account. Use a [subaccount](/docs/cli/apis/account#subaccounts) with the minimum products enabled for automated use, and protect the machine that holds the profile.
</Warning>

Useful companions in scripts:

```bash theme={null}
export PLIVO_FEEDBACK_PROMPT=0    # never show the "rate the CLI?" prompt
export CI=1                       # disables all TTY-only interactions
export PLIVO_CLI_TELEMETRY=0      # see Telemetry
```

## Switch between accounts

A profile is a saved set of credentials. Most people have one; if you work across several Plivo accounts or subaccounts, save one profile per account and switch between them.

**Command:** `plivo auth <subcommand>`

#### `plivo auth list`

List saved profiles and show which one is active.

#### `plivo auth use <name>`

Make a saved profile the active one for subsequent commands.

#### `plivo auth whoami`

Show the account behind the credentials the CLI would use right now: including whether they came from a profile or from environment variables (`"meta": {"source": "env"}`).

```bash theme={null}
plivo auth whoami -o json
```

#### `plivo auth remove <name>`

Delete a profile and its stored token.

**Per-command override**

Any command accepts `--profile <name>` to run once under a different profile without switching:

```bash theme={null}
plivo --profile staging numbers list
```

<Note>
  Credential precedence is: `--profile` flag → the active profile.
</Note>

## Log out

Remove a saved profile and delete its auth token from the operating system's credential store.

**Command:** `plivo logout [profile]`

**Flags**

* `[profile]`: the profile to log out (default: the active profile).

**Examples**

```bash theme={null}
plivo logout
plivo logout staging
```
