# kindgi auth

> Manage local auth: the API's URL and token, and the runtime image's registry

## `kindgi auth`

**Synopsis**

```sh signature
kindgi auth <command>
```

Manage local auth: the API's URL and token, and the runtime image's registry.

**Commands**

| Command                                                                                             | Description                                                                                      |
| --------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------ |
| [`kindgi auth login`](https://docs.kindgi.com/v0.1.8/reference/cli/auth.md#kindgi-auth-login)       | Persist an API URL + token to \~/.kindgi/config.json.                                            |
| [`kindgi auth whoami`](https://docs.kindgi.com/v0.1.8/reference/cli/auth.md#kindgi-auth-whoami)     | Verify the configured token by hitting the API.                                                  |
| [`kindgi auth registry`](https://docs.kindgi.com/v0.1.8/reference/cli/auth.md#kindgi-auth-registry) | Log Docker in to the runtime image's registry, then check it can pull the image kindgi dev runs. |

**See also**

- [Install](https://docs.kindgi.com/v0.1.8/start/install.md)

### `kindgi auth login`

**Synopsis**

```sh signature
kindgi auth login [--url=<url>] [--token=<token>]
```

Persist an API URL + token to \~/.kindgi/config.json.

**Options**

Every command also takes the [global flags](https://docs.kindgi.com/v0.1.8/reference/cli.md#global-flags).

**Examples**

Save the API URL, and the API token exported as `KINDGI_API_TOKEN`, to \~/.kindgi/config.json.

```sh
kindgi auth login --url=https://kindgi.acme.example
```

**See also**

- [Install](https://docs.kindgi.com/v0.1.8/start/install.md)
- [`kindgi auth`](https://docs.kindgi.com/v0.1.8/reference/cli/auth.md#kindgi-auth)

### `kindgi auth whoami`

**Synopsis**

```sh signature
kindgi auth whoami
```

Verify the configured token by hitting the API.

**Options**

Every command also takes the [global flags](https://docs.kindgi.com/v0.1.8/reference/cli.md#global-flags).

**Examples**

Check that the saved token works against the API.

```sh
kindgi auth whoami
```

**See also**

- [Install](https://docs.kindgi.com/v0.1.8/start/install.md)
- [`kindgi auth`](https://docs.kindgi.com/v0.1.8/reference/cli/auth.md#kindgi-auth)

### `kindgi auth registry`

**Synopsis**

```sh signature
kindgi auth registry [--username <name>] [--password-stdin] [--check] [--registry <host>]
```

Log Docker in to the runtime image's registry, then check it can pull the image kindgi dev runs.

**Options**

| Option               | Default                                 | Description                                                                                                                                         |
| -------------------- | --------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------- |
| `--check`            | off                                     | Only check that Docker can pull the image, without logging in.                                                                                      |
| `--password-stdin`   | off                                     | Read the token from stdin instead of prompting for it.                                                                                              |
| `--registry <value>` | `quay.io`, the runtime image's registry | The registry to log in to, such as a mirror; the check then looks for the image there. Default: the runtime image's registry (`quay.io`).           |
| `--username <value>` | required (except with `--check`)        | Your pull credential's robot name, shown at [https://access.kindgi.com](https://access.kindgi.com/) once you sign in with GitHub. Needed to log in. |

Every command also takes the [global flags](https://docs.kindgi.com/v0.1.8/reference/cli.md#global-flags).

**Examples**

Log Docker in to the runtime image's registry with the robot name you were given, then check the pull; the token is prompted for.

```sh
kindgi auth registry --username=acme+reader
```

Log in in a script, reading the token from stdin.

```sh
kindgi auth registry --username=acme+reader --password-stdin < registry-token.txt
```

Check that Docker can already pull the image, without logging in.

```sh
kindgi auth registry --check
```

From [Install](https://docs.kindgi.com/v0.1.8/start/install.md):

```sh
npx --yes @kindgi/cli@0.1 auth registry --username <your robot name>
```

**See also**

- [Install](https://docs.kindgi.com/v0.1.8/start/install.md)
- [`kindgi auth`](https://docs.kindgi.com/v0.1.8/reference/cli/auth.md#kindgi-auth)
