pols login
Store an API key (stdin, or POLS_API_KEY), log in by email like pols signup (--email), or with a handoff link (--handoff)
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 are made on my.pols.so/account/agents.
There is deliberately no --api-key flag: a key on the command line ends up
in shell history.
With --email, login is an alias of pols signup --email, which needs
no key: pols emails the address a link and a code, which this command prints too.
The person there checks that the codes match and approves with one click on
my.pols.so: for an address without an account that creates it (they accept
the terms and the free trial starts), and approving logs an existing
account’s owner in. Meanwhile the command waits, for at most 15 minutes,
then saves a new API key named “created by agent on <date>” like pols login
does. The key acts as that person and can be revoked on my.pols.so like any
other. Nothing is created before they approve.
An agent whose commands time out can pass --no-wait, show the person the
code, and run the same command again to wait: it resumes the same request
instead of emailing again.
With --handoff, login redeems a one-time handoff link the person made on
my.pols.so/account/agents for a new API key with the scope they chose, and
stores it. A link works once, for 15 minutes; its key is named “created by
agent on <date>” with the link’s label.
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
pols login [--email ADDRESS | --handoff LINK] [flags]
Examples
echo "$KEY" | pols login
pols login --api-url http://localhost:8080 < key.txt
pols login --email ada@example.com # the same as pols signup --email
pols login --handoff 'https://my.pols.so/agent/handoff#...'
Flags
--email string log in by approving an email sent to this address, creating the account if it has none
--handoff string redeem a one-time handoff link made on my.pols.so/account/agents for a new API key
-h, --help help for login
--name string how this agent describes itself in the email and the key's name (default "pols CLI on <hostname>")
--no-wait ask and print the code, then exit; run the same command again to wait for the approval
--org string the org the key is for, one of the account's (pols org list); default: the one it used last
The global flags work with this command too.