---
createdAt: 2025-12-16
updatedAt: 2025-12-16
title: CLI - Login
description: Learn how to use the Intlayer CLI login command to authenticate with the Intlayer CMS and obtain access credentials.
keywords:
  - CLI
  - Login
  - Authentication
  - CMS
  - Intlayer
  - Credentials
slugs:
  - doc
  - concept
  - cli
  - login
---

# Intlayer CLI Login Command

---

## Description

The `login` command of the Intlayer CLI allows you to authenticate with the Intlayer CMS. This command automatically opens your default browser to complete the authentication process and receive the necessary credentials (Client ID and Client Secret) to use Intlayer services.

## Usage

```bash
npx intlayer login [options]
```

or

```bash
intlayer login [options]
```

## Options

### `--cms-url <url>`

Specify the URL of the Intlayer CMS to connect to for authentication.

- **Type**: `string`
- **Default**: The value configured in `intlayer.config.*` or `https://intlayer.org`
- **Example**:

```bash
npx intlayer login --cms-url https://intlayer.org
```

### Configuration Options

You can also use common configuration options:

- `--env-file <path>`: Path to the environment file
- `-e, --env <env>`: Execution environment
- `--base-dir <dir>`: Base directory of the project
- `--verbose`: Enable detailed output (default: true)
- `--prefix <prefix>`: Prefix for logs

## How It Works

1. **Local server start**: The command starts a local HTTP server on a random port to receive credentials from the CMS

Specify the URL of the Intlayer CMS to connect to for authentication.

- **Type**: `string`
- **Default**: The value configured in `intlayer.config.*` or `https://intlayer.org`
- **Example**:

```bash
npx intlayer login --cms-url https://intlayer.org
```

### Configuration Options

You can also use common configuration options:

- `--env-file <path>`: Path to the environment file
- `-e, --env <env>`: Execution environment
- `--base-dir <dir>`: Base directory of the project
- `--verbose`: Enable verbose output (default: true)
- `--prefix <prefix>`: Prefix for logs

## How It Works

1. **Local Server Start**: The command starts a local HTTP server on a random port to receive credentials from the CMS.
2. **Browser opening**: The command automatically opens your default browser to the CMS login URL
3. **Authentication**: Complete the authentication in the browser using your Intlayer account
4. **Credentials reception**: The local server receives the Client ID and Client Secret from the CMS
5. **Instructions**: The command displays instructions for configuring credentials in your project

## Output

After a successful login, the command will display:

1. **The received credentials** (Client ID and Client Secret)
2. **Instructions for the `.env` file**:

```bash
INTLAYER_CLIENT_ID=your_client_id
INTLAYER_CLIENT_SECRET=your_client_secret
```

3. **Instructions for the Intlayer configuration file**:

```typescript
{
  editor: {
    cmsURL: 'https://intlayer.org',
    clientId: process.env.INTLAYER_CLIENT_ID,
    clientSecret: process.env.INTLAYER_CLIENT_SECRET,
  },
}
```

## Manual Configuration

If the browser does not open automatically, you can manually visit the URL displayed in the terminal.

## Examples

### Login with Custom CMS URL

```bash
npx intlayer login --cms-url https://custom-cms.example.com
```

### Login with Specific Environment File

```bash
npx intlayer login --env-file .env.production
```

### Login in Verbose Mode

```bash
npx intlayer login --verbose
```

## Troubleshooting

### Browser Doesn't Open

If the browser does not open automatically, copy the URL displayed in the terminal and open it manually in your browser.

### Connection Issues

If you encounter connection issues, verify:

1. That the CMS URL is correct
2. That your internet connection is working correctly
3. That no firewalls are blocking the connection

### Credentials Not Received

If credentials are not received:

1. Ensure you have completed the authentication process in the browser
2. Verify that the local port is not blocked
3. Try the command again

## Next Steps

After completing the login:

1. Add the credentials to your `.env` file
2. Configure your `intlayer.config.*` file with the credentials
3. Use CLI commands to manage your dictionaries:
   - [`npx intlayer push`](https://github.com/aymericzip/intlayer/blob/main/docs/docs/en-GB/cli/push.md) - Push dictionaries to the CMS
   - [`npx intlayer pull`](https://github.com/aymericzip/intlayer/blob/main/docs/docs/en-GB/cli/pull.md) - Pull dictionaries from the CMS
   - [`npx intlayer fill`](https://github.com/aymericzip/intlayer/blob/main/docs/docs/en-GB/cli/fill.md) - Fill in missing translations

## See Also

- [CLI Documentation](https://github.com/aymericzip/intlayer/blob/main/docs/docs/en-GB/cli/index.md)
- [Intlayer Configuration](https://github.com/aymericzip/intlayer/blob/main/docs/docs/en-GB/configuration.md)
- [Intlayer CMS](https://github.com/aymericzip/intlayer/blob/main/docs/docs/en-GB/intlayer_CMS.md)
