Skip to content
Skip to main content

Get started with the Nylas CLI

The Nylas CLI is an open-source command-line tool that handles the entire Nylas setup — account creation, app configuration, API key generation, and account connection — in a single interactive command.

  1. Install using your preferred method:

  2. Verify the installation:

    nylas --version

Run the init wizard. It walks you through four steps in under a minute:

  1. Create an account (or log into an existing one) via Google, Microsoft, or GitHub SSO
  2. Select an application (or create a new one)
  3. Generate an API key (named automatically for easy identification in the Dashboard)
  4. Connect an email account from your synced accounts
nylas init

You can also sign up with a specific SSO provider:

nylas init --google
nylas init --microsoft

If you already have an API key from the Dashboard, skip the wizard entirely:

nylas init --api-key <NYLAS_API_KEY>

For EU data residency:

nylas init --api-key <NYLAS_API_KEY> --region eu

Once nylas init completes, you’re ready to make API calls. The CLI displays your grant ID (the connected account identifier) at the end of setup.

List your five most recent messages using the CLI:

nylas email list --limit 5

Or call the Nylas API directly with curl. Replace <NYLAS_GRANT_ID> and <NYLAS_API_KEY> with the values from the setup step.

Add another email account at any time:

nylas auth login

List all connected accounts:

nylas auth list

Switch between accounts:

nylas auth switch

Here are some commands to try now that you’re set up:

CommandWhat it does
nylas email listList recent messages
nylas email send --to [email protected] --subject "Hello" --body "Hi"Send an email
nylas email search --query "from:[email protected]"Search messages
nylas calendar events listList upcoming calendar events
nylas calendar events create --title "Standup" --start "tomorrow 9am" --end "tomorrow 9:30am"Create an event
nylas contacts listList contacts
nylas webhook listList configured webhooks

The CLI also includes AI-powered features:

CommandWhat it does
nylas email smart-compose --prompt "Reply saying I'll be there"Draft an email with AI
nylas calendar schedule ai "Coffee with Alex next Tuesday"Schedule with natural language
nylas chatOpen the AI chat interface

Add --json to any command for machine-readable output, or pipe to jq for filtering:

nylas email list --limit 10 --json | jq '.[].subject'

See the full CLI command reference for 100+ commands covering email, calendar, contacts, webhooks, and more.