---
title: "pols login"
description: "Store an API key (read from stdin, or POLS_API_KEY)"
---

<!-- Generated by scripts/reference.mjs from the pols CLI's --help. Do not edit; run `npm run reference:sync`. -->

Store an API key for later commands. The key is read from POLS\_API\_KEY or
from the first line of stdin, checked against the API, and saved in the user
config directory (mode 0600). Keys come from your org admin, or from an
existing key with the API. There is deliberately no `--api-key` flag: a key on
the command line ends up in shell history.

On a terminal, login then offers to install the pols agent skill for Claude
Code and to register `pols mcp` with it (claude mcp add `--scope` user),
where either is missing. The registration holds no key: pols mcp reads the
stored one.

## Usage

```text
pols login [flags]
```

## Examples

```sh
echo "$KEY" | pols login
pols login --api-url http://localhost:8080 < key.txt
```

## Flags

```text
-h, --help   help for login
```

The [global flags](/reference/cli/#global-flags) work with this command too.
