> ## Documentation Index
> Fetch the complete documentation index at: https://checkly-422f444a-simo-red-943-deploy-plan-docs.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# checkly login

> Sign up for a new Checkly account or log in to your existing account.

The `checkly login` command authenticates with Checkly by signing up for a new account or logging in to your existing account.

The CLI shows a URL and a short code. Open the URL in a browser on any device, enter the code, and log in or sign up there. The browser doesn't have to run on the same machine as the CLI, so this also works over SSH, in containers and from AI agents.

<Accordion title="Prerequisites">
  Before using `checkly login`, ensure you have:

  * Checkly CLI installed
  * A web browser on any device (it doesn't have to be the machine running the CLI)
  * Internet connection for authentication flow

  No existing Checkly account is required - you can sign up during the login process.
</Accordion>

## Usage

The basic command initiates the login process and authenticates with your Checkly account.

```bash Terminal theme={null}
npx checkly login
```

<Tip>Use environment variables in environments without interactive prompts. See the [Authentication section](/cli/authentication#other-authentication-options) for more info.</Tip>

## Examples

```bash Terminal theme={null}
npx checkly login

Visit auth.checklyhq.com/activate and enter ABCD-EFGH

Waiting for you to finish in the browser... ✅

✔ Which account do you want to use? › Monitoring as Code

Logged in as Raccoon to Monitoring as Code.

To create checks for a project, run `npx checkly init`.
```

## Options

| Option | Description |
| - | - |
| `--account-id <id>` | Use this account instead of asking which one. When you're already logged in, switch to it without logging in again. |
| `--no-browser` | Only print the URL and code; don't try to open a browser. Setting `CHECKLY_NO_BROWSER=1` does the same, e.g. on headless hosts. |

## Authentication Flow

The login process will:

1. **Show a URL and a code**, and open your default browser on that URL when it can
2. **Wait** until you have logged in or signed up in the browser
3. **Prompt for account selection** if you have multiple accounts
4. **Store authentication tokens** locally for future CLI usage
5. **Display confirmation** with your account information

Commands that need authentication start the same login when no credentials are stored, so you don't have to run `checkly login` first.

### AI agents

When the CLI runs under an AI agent, `checkly login` prints a JSON line with the URL and code for the agent to pass on to you, and exits instead of waiting. After you've approved the login in the browser, the agent runs the command again to finish it. In CI, set [environment variables](/cli/authentication#from-ci) instead.

### New Users

If you don't have a Checkly account:

1. Click "Sign up" on the authentication page
2. Complete account registration
3. Return to the CLI - you'll be automatically logged in

### Existing Users

If you already have an account:

1. Enter your credentials on the authentication page
2. Complete any two-factor authentication if enabled
3. Return to the CLI - authentication will complete automatically

## Authentication Storage

After successful login, the CLI stores authentication tokens locally in:

* **macOS**: `~/Library/Preferences/@checkly/cli/auth.json`
* **Linux**: `~/.config/@checkly/cli/auth.json`
* **Windows**: `%APPDATA%\@checkly\cli\Config\auth.json`

The file is plain JSON and is not encrypted. The stored tokens are used for subsequent CLI operations without requiring re-authentication.

## Troubleshooting

### Browser doesn't open automatically

Open the displayed URL in a browser on any device and enter the code.

### Logging in as a different user

Run [`checkly logout`](/cli/checkly-logout) first, then `checkly login` again.

### Multiple accounts

If you have access to multiple Checkly accounts, you'll be prompted to select which account to use as the active account for CLI operations.

You can also switch accounts later using [`checkly switch`](/cli/checkly-switch) or `checkly login --account-id <id>`.

## Related Commands

* [`checkly logout`](/cli/checkly-logout) - Sign out of your Checkly account
* [`checkly whoami`](/cli/checkly-whoami) - Display current account information
* [`checkly switch`](/cli/checkly-switch) - Switch between multiple accounts


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