---
title: "tori login"
description: "sign in through the browser and save the token"
---

sign in through the browser and save the token

## Usage

```
npx tori.host login
```

Open a browser, sign in (or sign up — they are the same click), and save an API token named after this machine to ~/.config/tori/config.json. It shows up in the Console under Settings → API tokens; revoking it there stops this machine deploying.

Over SSH, in a container, or with no DISPLAY, the CLI prints a short code and a URL instead of opening a browser. `--no-browser` selects that flow on a machine that does have a browser. BROWSER=none does the same through the environment.

In CI there is nobody to approve a sign-in: set TORI_TOKEN to a token minted in the Console.

## Options

- `--no-browser` — sign in with a code you type on another device (chosen automatically over SSH or with no DISPLAY)


## Environment

- `TORI_TOKEN` — API token (overrides the config file; for CI)
- `TORI_API_URL` (default: https://api.tori.host) — API base URL
- `BROWSER` — command used to open the browser; none = never
- `TORI_LOGIN_TIMEOUT_MS` (default: 5m) — how long to wait for sign-in

## Examples

### Sign in

```sh
npx tori.host login
```

### Sign in from a machine with no browser

```sh
npx tori.host login --no-browser
```

This reference matches `tori.host@0.9.7`.

Download this page as [Markdown](/downloads/markdown/cli/login.md).
