Command
nylas auth config
Configure API credentials for the Nylas CLI.
Written by Qasim Muhammad Staff SRE
What does nylas auth config do?
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. Credentials are saved to ~/.config/nylas/ by default.
Usage
nylas auth config [--api-key KEY]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 | Set API key directly (non-interactive) |
| --client-id | Nylas Client ID (auto-detected if not provided) |
| --region(-r) | API region (us or eu) |
| --reset | Reset all configuration |
Examples
Interactive configuration
nylas auth config
# Paste your API key when promptedNon-interactive (CI/scripts)
export NYLAS_API_KEY=your_api_key
nylas auth configExample output
✓ Configuration saved
API Key: nyl_••••••••••••a1b2
Client ID: app-7f3c (auto-detected)
Region: us
✓ Credentials stored in system keyringTroubleshooting
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.
Recommended guides
List Fastmail emails from the CLI
List Fastmail emails from the CLI through Nylas IMAP access, using app passwords, inbox filters, JSON output, and Fastmail-specific auth troubleshooting.
Book meeting rooms from the CLI
Book meeting rooms from the CLI by listing calendar resources, using each room email as a calendar ID, and adding it as an event participant with less setup.
OfflineIMAP vs Nylas: Python IMAP sync
OfflineIMAP is a Python tool that syncs IMAP mail to local Maildir. Compare its config, Gmail OAuth2, sync speed, and an API email CLI that skips the mirror.
neomutt vs Nylas: IMAP reader vs email API
neomutt is a configurable IMAP terminal mail reader. Compare it to an API-backed email CLI on OAuth setup, scripting, offline access, and calendar reach.
mbsync vs Nylas: IMAP sync vs email API
mbsync (isync) syncs IMAP mailboxes to local Maildir for mutt or neomutt. Compare its sync model, Gmail OAuth setup, and where an API email CLI skips it.
Google Calendar API Sync Tokens
Use Google Calendar API sync tokens for incremental event sync, handle the 410 GONE full-resync, and read calendars from the CLI.
Run nylas auth config --help for full help output.