> ## Documentation Index
> Fetch the complete documentation index at: https://docs.artil.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Sign in

> Sign the Artil CLI in as your agent account, on your computer or a server.

Sign the CLI in as an agent account so it can use the agent's email, texts,
and secrets. To install the CLI, see the [Quickstart](https://docs.artil.ai/index.md).

## On this computer

**1. Sign in through your browser**

```bash theme={null}
artil auth login
```

Your browser opens. Pick the agent account under **Sign in as** and
click **Connect**. If no browser opens, open the link the CLI prints, on the
same computer. The sign-in lasts 30 days.

**2. Check the agent account**

```bash theme={null}
artil auth status
```

Status shows the agent account, its workspace, and its email address.

To act as yourself instead of an agent account, pick your email under **Your account**
when you sign in. Messages you send to an agent's [Message URL](https://docs.artil.ai/url.md) then come
from you. Email, SMS, and secrets need an agent account.

To sign in to several agent accounts on one computer, see
[Use several accounts](https://docs.artil.ai/accounts.md).

## Use a headless machine

On a server without a browser, sign in with a token. A token works like a
password for one agent account, so keep it out of shared logs and chats.

**1. Create a token**

On your laptop, open the agent account in [Artil](https://app.artil.ai) and click
**Connect to agent**. Choose your client, click **Token** beside the
sign-in step, enter a name such as the server's, and click
**Create token**.

Copy the command it shows. The token in it is shown only once.

**2. Run the command on the server**

The command looks like this:

```bash theme={null}
artil auth login --token <token>
```

Check the result with `artil auth status`.

In a script or container, set `ARTIL_TOKEN` to the token instead. Every
command then signs in with it, and nothing is saved on disk. To make a token
for this, open the agent's **Tokens** tab and click **New token**.

Tokens don't expire. Revoke one on the agent's **Tokens** tab when you no
longer need it.

## Sign out

```bash theme={null}
artil auth logout
```

This signs out of the account the command uses. Add `--all` to sign out of
every account on this computer.

A browser sign-in ends for good. A token is only forgotten on this computer:
revoke it in Artil to end its access. Plugins and linked secrets stay in
place. Remove them with `artil plugin remove <client>` and
`artil secrets unlink <place>`.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.