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

# Device login and auth

> Understand CLI device-code login and local profile/token handling.

The CLI uses a device-code flow backed by API routes:

* `POST /api/cli/v1/device/start`
* `POST /api/cli/v1/device/poll`
* `POST /api/cli/v1/device/approve` (browser session)

## Flow

1. `minenet login` starts a device auth request.
2. You open the provided URL and approve in a browser.
3. CLI polls until it receives a team-scoped bearer token.
4. The local daemon stores the selected team profile and token.

## Token format

* User token prefix: `mnp_`
* Agent token prefix: `mna_`

## Local session behavior

* Profiles are stored per team.
* One current team is active at a time.
* `minenet logout` removes local profile state.
* You can override API base URL with `--api`.
