# token_required

> `disko login --with-token` read no token, because stdin is a terminal or is empty.

| | |
| --- | --- |
| Kind | `disko` command error |
| `disko` exit code | 2 (usage) |

`disko login --with-token` reads the CLI token from stdin and never waits for
keyboard input. When stdin is a terminal or empty, the command fails with
`token_required` and exits with code 2. Tokens are never accepted as
command-line arguments, because arguments are visible in process lists;
passing one fails with `usage`.

## Wrong

```sh
disko login --with-token
```

## Right

```sh
disko login --with-token < token.txt
printf '%s' "$DISKO_TOKEN" | disko login --with-token
```

For a single run, you can skip storing the token and set `DISKO_TOKEN` in the
environment instead.

## See also

- [CLI tokens](/registry/cli-tokens)
- [usage](/errors/usage)
