Source: https://cli.nylas.com/docs/commands/init

# nylas init

Guided setup wizard for first-time Nylas CLI users.

Written by [Qasim Muhammad](https://cli.nylas.com/authors/qasim-muhammad) Staff SRE

Published February 13, 2026

Updated June 21, 2026

## What does nylas init do?

The nylas init command walks you through setting up the Nylas CLI in four steps: creating or logging into your Nylas account, selecting or creating an application, generating an API key, and syncing your connected email accounts. If you already have an API key, pass --api-key to skip the interactive wizard. Works with Gmail, Outlook, Exchange, Yahoo, iCloud, and IMAP.

## Usage

```bash
nylas init [--api-key KEY] [--region us|eu] [--google|--microsoft|--github]
```

## Flags

| Flag | Description |
| --- | --- |
| --json | Output as JSON |
| --no-color | Disable color output |
| --verbose(-v) | Enable verbose output |
| --config | Custom config file path |
| --help(-h) | Show help for the command |
| --limit | Limit results (most list commands) |
| --yes(-y) | Skip confirmations |
| --api-key | Nylas API key (skips interactive wizard) |
| --region(-r) | API region: us or eu (default: us) |
| --google | Use Google SSO for account creation/login |
| --microsoft | Use Microsoft SSO for account creation/login |
| --github | Use GitHub SSO for account creation/login |
| --client-id | Nylas Client ID to use with --api-key |

## Examples

The nylas init command walks you through setting up the Nylas CLI in four steps: creating or logging into your Nylas account, selecting or creating an application, generating an API key, and syncing your connected email accounts.

### Interactive guided setup

```bash
nylas init
# Follow the 4-step wizard:
#   Step 1: Create account or log in
#   Step 2: Select or create application
#   Step 3: Generate API key
#   Step 4: Sync email accounts
```

### Quick setup with existing API key

```bash
nylas init --api-key nyl_abc123
```

### Quick setup for EU region

```bash
nylas init --api-key nyl_abc123 --region eu
```

### Start with Google SSO

```bash
nylas init --google
```

## Example output

```text
✓ Logged in to Nylas
✓ Application: My App (app-7f3c)
✓ API key generated and activated
✓ Region: us
✓ Connected account: alice@example.com

Setup complete. Try: nylas email list
```

## Troubleshooting

### Wizard fails with 'non-interactive mode requires --api-key'

The wizard needs a terminal (TTY). In CI/CD or scripts, pass --api-key directly.

### SSO browser window doesn't open

Copy the URL printed in the terminal and open it manually in your browser.

### API key verification fails

Check the key at dashboard-v3.nylas.com. Ensure no extra whitespace when pasting.

## Recommended guides

[Automate Customer Onboarding EmailsRun a multi-day onboarding sequence from a signup hook with nylas email send --schedule and hosted templates — no marketing platform, no SMTP.](https://cli.nylas.com/guides/customer-onboarding-emails-cli)

[Getting Started with Agent AccountsHow Nylas Agent Account works. Architecture from Application to Workspace, inbound and outbound email flows, and why managed email replaces SMTP for AI agents.](https://cli.nylas.com/guides/getting-started-agent-accounts)

[Set Up an MCP Email Server in 5 MinutesConnect AI agents to real email accounts through MCP. Install, configure, and verify an email MCP server for Claude Code, Cursor, and other AI coding tools.](https://cli.nylas.com/guides/mcp-email-server-setup)

[Install Nylas Skills for AI Coding AgentsInstall nylas-cli and nylas-api skills in Claude Code, Cursor, Codex CLI, Windsurf, and 30+ AI coding agents. One command adds email and calendar tools.](https://cli.nylas.com/guides/nylas-agent-skills)

[Getting Started with the CLISet up Nylas CLI in under 2 minutes. Create a free Nylas account, get an API key from the dashboard, and run nylas auth config. No browser auth flow needed.](https://cli.nylas.com/guides/getting-started)

[Give Your AI Coding Agent an Email AddressConnect Claude Code, Cursor, OpenAI Codex CLI, Windsurf, and OpenClaw to a real email account via MCP. Step-by-step setup for each tool using Nylas CLI.](https://cli.nylas.com/guides/give-ai-agent-email-address)

Run `nylas init --help` for full help output.
