# Sign-in commands

> Reference for langalpha login, logout and whoami, the CLI commands that sign you in to a LangAlpha server, sign you out, and show who the server takes you for.

Source: https://docs.langalpha.ai/cli/auth/

These three commands manage your sign-in. [Signing in](https://docs.langalpha.ai/cli/signing-in/) explains the credential order and browser sign-in in full, including how to sign in on a remote machine. Every command also takes the [global options](https://docs.langalpha.ai/cli/overview/#global-options).

## login

Sign in to a server through the browser.

```sh
langalpha login [--with-token] [--no-browser]
```

| Option | What it does |
| --- | --- |
| `--with-token` | Read a personal access token from standard input. |
| `--no-browser` | Print the sign-in page without opening it. See [Signing in on a remote machine](https://docs.langalpha.ai/cli/signing-in/#signing-in-on-a-remote-machine). |

`login` asks the server how it takes a sign-in. A server that asks for none is only recorded as your default. Otherwise the CLI signs in through the browser. Either way the server becomes your default for later commands.

```sh
langalpha login --server https://<your-server>
```

## logout

Forget your sign-in to the server.

```sh
langalpha logout
```

Removes the saved sign-in for the default server, or for `--server`, and clears the default if it was that server. Prints "Not signed in to ..." when there was nothing to forget. Nothing is revoked on the server.

## whoami

Show who the server takes you for, and what you may do.

```sh
langalpha whoami
```

Prints the server, your user id, how you are signed in (`session`, `oauth`, `computer` or `service`), your scopes, and for a computer's token the computer's id. `--json` prints the server's full answer. A token without `agent:read` can still run `whoami`, so it is a quick way to check that a token works at all.

## Related

- [Signing in](https://docs.langalpha.ai/cli/signing-in/)
- [Authentication](https://docs.langalpha.ai/api/authentication/)
