Guide

Getting Started

Set up Nylas CLI in under 2 minutes. Run nylas init for guided signup that creates your account, application, and API key and connects your email in one flow. Already have an API key? Log in with nylas auth config, then connect mailboxes with nylas auth login.

Written by Prem Keshari Senior SRE

Reviewed by Caleb Geene

VerifiedCLI 3.1.1 · Gmail, Outlook, IMAP · last tested April 11, 2026

How do I install Nylas CLI?

Nylas CLI installs as a single 12 MB static binary with no runtime dependencies. Pick the method that matches your platform — each option auto-detects your CPU architecture (x86_64 or arm64), downloads the correct build from GitHub, and verifies the download with SHA-256 checksums. Installation completes in under 30 seconds on most connections.

Homebrew (macOS and Linux)

The Homebrew formula taps the nylas/nylas-cli repository and pins the latest stable release. Homebrew handles upgrades automatically when you run brew upgrade.

brew install nylas/nylas-cli/nylas

Shell script (macOS, Linux, WSL)

The shell installer works on any POSIX system, including WSL. It writes the binary to ~/.config/nylas/bin and prints a PATH export line you can add to your shell profile.

curl -fsSL https://cli.nylas.com/install.sh | bash

PowerShell (Windows)

The PowerShell installer downloads the Windows binary and adds the install directory to your user-level PATH. It requires PowerShell 5.1 or later, which ships with Windows 10 and 11.

irm https://cli.nylas.com/install.ps1 | iex

Go

Building from source requires Go 1.23 or later. The binary lands in your $GOPATH/bin directory.

go install github.com/nylas/cli/cmd/nylas@latest

After installing with any method, confirm the binary is on your PATH by printing its version:

nylas --version

How do I set up Nylas CLI after installing?

Two setup paths exist after installation. New users run nylas init, an interactive wizard that creates a Nylas account, builds an application, generates an API key, and connects your first email account in one session. If you already have an API key, run nylas auth config to log in. Add mailboxes with nylas auth login — the free tier connects up to 5 accounts.

How do I set up with nylas init?

The nylas init wizard is the fastest path for new users. It runs four steps in one interactive session: log into or create a Nylas account, select or create an application, generate and activate an API key, then sync your existing email accounts. The flow takes about 90 seconds and opens a browser once for SSO sign-in.

nylas init

The wizard prompts for an SSO provider (Google, Microsoft, or GitHub), then walks through application and key creation before connecting your mailbox. To skip the provider menu, pass the flag directly:

nylas init --google
nylas init --microsoft
nylas init --github

When the wizard finishes, your account is authenticated and your email is connected. Confirm it by listing your inbox:

nylas email list

How do I log in with an existing API key?

Already have an API key from the Nylas Dashboard? Run nylas auth config and paste it when prompted to log in — this skips the 4-step wizard. The CLI validates the key in under a second and saves it encrypted, with no browser or SSO redirect, ideal for CI/CD pipelines, Docker containers, and SSH sessions.

nylas auth config

Pass the key as a flag for non-interactive setup, and add --region eu if your application lives in the EU region. The key starts with nyl_:

nylas auth config --api-key nyl_abc123
nylas auth config --api-key nyl_abc123 --region eu

How do I get an API key from the dashboard?

New to Nylas but prefer the dashboard over the wizard? Generate an API key in three steps, then log in with nylas auth config above. The free tier includes 5 connected accounts and needs no credit card.

  1. Sign up at dashboard-v3.nylas.com with Google, Microsoft, or GitHub SSO.
  2. Create an application — open All apps, create a new app, and choose your region (US or EU).
  3. Generate an API key — open the app's API Keys section and click Create new key. The key starts with nyl_.

Logging in with a key authenticates the CLI against your application but connects no mailbox yet. Connect your first email account with nylas auth login, the same command used to add more accounts later (covered next).

How do I connect email accounts?

Connect a mailbox with nylas auth login. The free tier connects up to 5 accounts (called grants) across Gmail, Outlook, Exchange, Yahoo, iCloud, and IMAP. Google is the default provider, so the bare command starts a Google sign-in; pass --provider for the other five. The CLI picks up each new grant automatically on the next command.

# OAuth providers (opens a browser)
nylas auth login --provider google
nylas auth login --provider microsoft
nylas auth login --provider ews

# Credential providers (app-specific password)
nylas auth login --provider icloud
nylas auth login --provider yahoo
nylas auth login --provider imap

According to Google's OAuth 2.0 documentation, access tokens expire after 3,600 seconds. The CLI stores the grant and refreshes tokens automatically, so you authorize once. List and switch between connected accounts with:

# List all connected accounts
nylas auth list

# Switch the active account
nylas auth switch

How do I manage my account from the CLI?

Nylas CLI mirrors about 90% of the web dashboard functionality through nylas dashboard subcommands. You can create applications, rotate API keys, switch organizations, and check your login status without opening a browser. Every subcommand supports --json output for scripting.

The most common dashboard operations:

# Check login status
nylas dashboard status

# List applications
nylas dashboard apps list

# Create a new application
nylas dashboard apps create --name "Production App" --region us

# Set an application as active
nylas dashboard apps use app_abc123

# Generate a new API key
nylas dashboard apps apikeys create

# Switch organizations
nylas dashboard orgs switch

How do I use email, calendar, and contacts?

Nylas CLI organizes its 72+ commands into three core groups: email (send, list, search, draft, attach), calendar (events, availability, scheduling), and contacts (list, search, groups). Each group supports --json output for scripting and --limit to control result size. Here are the commands you'll use most after setup:

# Email: list, search, and send
nylas email list --limit 5
nylas email search "quarterly report"
nylas email send --to colleague@company.com --subject "Quick note" --body "See you at 2pm."

# Calendar: list events and check availability
nylas calendar events list --days 7
nylas calendar availability check --start 2026-05-12T09:00:00Z --end 2026-05-12T17:00:00Z --emails colleague@company.com

# Contacts: list and search
nylas contacts list --limit 10
nylas contacts search --query "Alice"
nylas contacts groups list

Add --json to any command to get structured output you can pipe into jq, feed to a script, or pass to an AI agent. The send email guide and calendar guide cover each group in depth.

How do I reset and start over?

Nylas CLI stores all configuration locally in ~/.config/nylas/ — typically 3-4 files totaling under 2 KB. Resetting removes API credentials, Dashboard session tokens, authenticated grants, and the config file — but it does not affect your Nylas Dashboard data or connected accounts on the server side. Your applications, grants, and API keys remain intact in the cloud.

To clear the local config and re-run setup:

nylas config reset
nylas init

Use --force to skip the confirmation prompt, which is useful in scripts that need to reconfigure the CLI automatically.

Next steps