> ## Documentation Index
> Fetch the complete documentation index at: https://forest-chore-open-api.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# forest login

> Authenticate the Forest CLI with your Forest account

# forest login

Sign in to your Forest account.

## Usage

```bash theme={null}
forest login [options]
```

## Options

| Option           | Description                                                |
| ---------------- | ---------------------------------------------------------- |
| `-e, --email`    | Your Forest account email                                  |
| `-P, --password` | Your Forest account password (ignored if `--token` is set) |
| `-t, --token`    | Your Forest account token                                  |

## Default behavior

Running `forest login` without arguments opens your browser to authenticate via your Forest account:

```bash theme={null}
$ forest login
# Your browser opens automatically.
# If it doesn't, visit the URL printed in the terminal and enter the confirmation code shown.
```

Once you confirm in the browser, the CLI stores your session and you're ready to use other commands.

## Login with email and password

You can bypass the browser flow by providing credentials directly:

```bash theme={null}
forest login --email you@company.com --password yourpassword
```

## Login with an application token

```bash theme={null}
forest login --token YOUR_APPLICATION_TOKEN
```

<Tip>
  Application tokens are useful in CI/CD pipelines or automated environments where opening a browser is not possible.
</Tip>

## Logging out

```bash theme={null}
forest logout
```

## Checking the current user

```bash theme={null}
forest user
```

## Token storage

The CLI stores your session token locally in `~/.forest.d/`. This directory is created automatically on first login.

<Warning>
  Do not commit the `~/.forest.d/` directory to version control. It contains your authentication credentials.
</Warning>

## Troubleshooting

**Browser does not open**
The CLI will print a URL and a confirmation code in the terminal. Open the URL manually and enter the code to complete authentication.

**Token expired**
Run `forest login` again to get a fresh session.

**Command requires authentication**
Most CLI commands require you to be logged in. Run `forest login` before using other commands.
