Every email, calendar, and contact operation requires auth. nylas auth logout manages that layer.
The nylas auth logout command disconnects an email account from the CLI by revoking its local session. Pass --grant to target a specific account; otherwise, it logs out the currently active grant.
Quick Start
brew install nylas/nylas-cli/nylas
nylas init
nylas auth logout
Syntax
nylas auth logout [--grant GRANT_ID]
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.
Key Flags
Run nylas auth logout --help to see all available flags. Add --json for machine-readable output — useful when piping into jq or feeding data to scripts.
nylas auth logout --help
Examples
Log out of the active account:
nylas auth logout
Log out a specific grant:
nylas auth logout --grant abc-123-def-456
Related Commands
-
nylas auth config— Configure API credentials for the Nylas CLI -
nylas auth login— Authenticate with a provider (Gmail, Outlook, etc.) to connect your mailbox -
nylas auth list— List all connected accounts (grants) -
nylas auth whoami— Show current user info for the active account
Full docs: nylas auth logout reference — all flags, advanced examples, and troubleshooting.
All commands: Nylas CLI Command Reference
Get started: brew install nylas/nylas-cli/nylas — other install methods
Top comments (0)