First time with the Nylas CLI? nylas init is where everything starts.
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.
Syntax
nylas init [--api-key KEY] [--region us|eu] [--google|--microsoft|--github]
Examples
Interactive guided setup:
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:
nylas init --api-key nyl_abc123
Quick setup for EU region:
nylas init --api-key nyl_abc123 --region eu
Start with Google SSO:
nylas init --google
How It Works
The setup wizard detects your environment and offers the fastest path to a working CLI installation. On macOS it uses Keychain for credential storage, on Linux it uses Secret Service, and in Docker/CI it falls back to encrypted file storage.
Key Flags
Run nylas init --help to see all available flags. Add --json for machine-readable output — useful when piping into jq or feeding data to scripts.
nylas init --help
Common Issues
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.
Full docs: nylas init reference — all flags, advanced examples, and troubleshooting.
All commands: Nylas CLI Command Reference
Get started: brew install nylas/nylas-cli/nylas — other install methods