DEV Community

Qasim Muhammad
Qasim Muhammad

Posted on

Configure API credentials for the Nylas CLI — nylas auth config Guide

Authentication is the gate between your terminal and your mailbox. nylas auth config handles it.

The nylas auth config command stores your Nylas API key so the CLI can authenticate requests to Gmail, Outlook, Exchange, Yahoo, iCloud, and IMAP providers. Run it interactively or pass --api-key for CI/CD pipelines and scripts.

Quick Start

brew install nylas/nylas-cli/nylas
nylas init
nylas auth config
Enter fullscreen mode Exit fullscreen mode

Syntax

nylas auth config [--api-key KEY]
Enter fullscreen mode Exit fullscreen mode

Examples

Interactive configuration:

nylas auth config
# Paste your API key when prompted
Enter fullscreen mode Exit fullscreen mode

Non-interactive (CI/scripts):

export NYLAS_API_KEY=your_api_key
nylas auth config
Enter fullscreen mode Exit fullscreen mode

How It Works

The CLI stores credentials securely in your system keychain (macOS Keychain, Linux Secret Service, or Windows Credential Manager). Tokens are refreshed automatically — you authenticate once and commands just work.

Common Issues

Invalid API key
Verify your key at dashboard-v3.nylas.com. Ensure no extra spaces when pasting.

Config not persisting
Check write permissions for ~/.config/nylas/ or the path in --config.


Full docs: nylas auth config reference — all flags, advanced examples, and troubleshooting.

All commands: Nylas CLI Command Reference

Get started: brew install nylas/nylas-cli/nylasother install methods

Top comments (0)