# kosa8 login

Sign in to your kosa8 account in the browser (or, with SERVER, to a registry)

## Usage

```
kosa8 login [SERVER]
```

Signs this machine in to your kosa8 account. It shows a short code and opens
https://app.kosa8.com/device in your browser, where you sign in, or create the
account, and confirm the code. One sign-in covers the CLI, the kosa8 desktop app
and kosa8 Cloud: the key is kept in ~/.kosa8/cloud.json (readable only by you),
and the account's plan is put on this machine. A new account starts on the free
Starter (no card); `kosa8 init` signs in and runs a first command.

No browser here? --no-browser prints the link; open it on any device.
In CI, use an API key instead: --key, KOSA8_API_KEY, or --with-token to read it
from stdin. Make a key in the dashboard: https://app.kosa8.com/app#keys

To log in to a container registry, name it or pass -u: kosa8 login ghcr.io -u NAME

## Flags

| Flag | Type | What it does | Default |
|---|---|---|---|
| `--api` | string | kosa8 Cloud API address (default: KOSA8_API_URL or KOSA8_CLOUD_URL, then https://api.kosa8.com) |  |
| `--key` | string | sign in with a kosa8 Cloud API key (k8c_live_…) instead of the browser; stays in shell history |  |
| `--no-browser` | bool | print the link instead of opening a browser |  |
| `--password, -p` | string | registry password or token (registry login) |  |
| `--password-stdin` | bool | read the registry password from stdin (registry login) |  |
| `--username, -u` | string | registry username (registry login) |  |
| `--with-token` | bool | read a kosa8 Cloud API key from stdin instead of the browser (CI) |  |

## Example

```
  kosa8 login
  kosa8 login --no-browser
  printf %s "$KOSA8_API_KEY" | kosa8 login --with-token
  kosa8 login ghcr.io -u me --password-stdin
```

---
Source: https://docs.kosa8.com/reference/login/
