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

# tm auth login

> Login via browser and store Control Plane tokens.

## Usage

```sh theme={null}
tm auth login [OPTIONS]
```

## Examples

### Start the browser login flow and store Control Plane tokens locally.

```sh theme={null}
tm auth login
```

### Print the login URL instead of opening a browser automatically.

```sh theme={null}
tm auth login --no-open-browser
```

### Fail the login flow if the browser exchange is still pending after 60 seconds.

```sh theme={null}
tm auth login --no-open-browser --max-wait-seconds 60
```

## Options

| Name                 | Type      | Required | Default | Details                                                                   |
| -------------------- | --------- | -------- | ------- | ------------------------------------------------------------------------- |
| `--no-open-browser`  | `boolean` | no       | `false` | Do not open the browser automatically (prints URL instead). Boolean flag. |
| `--max-wait-seconds` | `float`   | no       | `300.0` | Maximum total wait time for the browser login flow before failing.        |
| `--timeout`          | `float`   | no       |         | HTTP timeout in seconds for the login flow.                               |

## Inherited Global Options

| Name                  | Type           | Required | Default                              | Details                                                                                                                      |          |    |          |                                                                   |
| --------------------- | -------------- | -------- | ------------------------------------ | ---------------------------------------------------------------------------------------------------------------------------- | -------- | -- | -------- | ----------------------------------------------------------------- |
| `--version`, `-V`     | `boolean`      | no       | `false`                              | Show the version and exit. Boolean flag.                                                                                     |          |    |          |                                                                   |
| `--config`            | `path`         | no       | `"~/.config/tensormesh/config.toml"` | Path to config TOML file                                                                                                     |          |    |          |                                                                   |
| `--output`            | \`choice\[text | json     | yaml                                 | raw                                                                                                                          | table]\` | no | `"text"` | Output format (text is human-readable; json is machine-friendly). |
| `--quiet`             | `boolean`      | no       | `false`                              | Suppress non-essential output. Boolean flag.                                                                                 |          |    |          |                                                                   |
| `--debug`             | `boolean`      | no       | `false`                              | Print debug logs to stderr (secrets redacted). Boolean flag.                                                                 |          |    |          |                                                                   |
| `--ca-bundle`         | `path`         | no       |                                      | Path to a PEM CA bundle for TLS verification (overrides TENSORMESH\_CA\_BUNDLE).                                             |          |    |          |                                                                   |
| `--max-retries`       | `integer`      | no       |                                      | Max retries for idempotent HTTP requests on transient errors (overrides TENSORMESH\_MAX\_RETRIES; subcommands may override). |          |    |          |                                                                   |
| `--controlplane-base` | `text`         | no       |                                      | Override the Control Plane base URL.                                                                                         |          |    |          |                                                                   |

## Auth Scope

* controlplane-browser-login

## Prerequisites

* Access to a browser that can complete the Tensormesh login flow.

## Caveats

* Tokens are stored locally after login completes.
* The login flow fails closed after 300 seconds unless `--max-wait-seconds` overrides it.

## Related Commands

* [`tm auth whoami`](/cli/reference/auth/whoami)
* [`tm auth refresh`](/cli/reference/auth/refresh)

## Parent Command

* [`tm auth`](/cli/reference/auth)
