Need to remove a connected account and all its local data? One command.
The nylas auth remove command permanently deletes a grant and its cached tokens from your local config. Use --force to skip the confirmation prompt in scripts and CI/CD pipelines.
Syntax
nylas auth remove --grant GRANT_ID [--force]
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.
Examples
Remove a specific account:
nylas auth remove --grant abc-123-def-456
Force remove without confirmation:
nylas auth remove --grant abc-123-def-456 --force
Tips
Script-friendly: Add --json for machine-readable output and --yes (where supported) to skip confirmations in automated pipelines.
CI/CD ready: This command works in non-interactive mode. Set NYLAS_API_KEY as an environment variable and it picks up credentials automatically.
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 remove 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)