> Canonical HTML: [https://docs.schematic.tech/pup/commands/account/](https://docs.schematic.tech/pup/commands/account/)

# Account commands

Pup uses an API key from your Schematic account to authenticate hosted commands.

## `pup login`

Sign in to [platform.schematic.tech](https://platform.schematic.tech) and generate an API key.
Then run `pup login` and enter the key when prompted:

**Bash**

```console
$ pup login
  ? Pup API key › [hidden]
  ✓ Logged in as you@example.com
```

Pup validates your API key and saves it locally for future commands.

## `pup logout`

Remove your saved API key from this computer:

**Bash**

```console
$ pup logout
  ✓ Logged out
```

Logging out does not revoke the API key, unlink your repositories, cancel checks, or delete results.

## Authenticate automated commands

Set the `PUP_ACCESS_TOKEN` environment variable to your API key to authenticate scripts and CI
without an interactive login. It takes precedence over your saved key.

Commands use this key without saving it, except for `pup login`, which validates and saves it locally.

`pup logout` does not unset `PUP_ACCESS_TOKEN`. Unset the variable to stop using it.

See [Automation and JSON](/pup/reference/automation/) for structured output and exit codes.
