Command

nylas auth switch

Switch active account.

Written by Qasim Muhammad Staff SRE

What does nylas auth switch do?

The nylas auth switch command changes which connected email account the CLI targets by default. After switching, all email, calendar, and contact commands operate against the new account without needing to pass the grant ID on every call.

Usage

nylas auth switch [grant-id]

Flags

FlagDescription
--jsonOutput as JSON
--no-colorDisable color output
--verbose(-v)Enable verbose output
--configCustom config file path
--help(-h)Show help for the command
--limitLimit results (most list commands)
--yes(-y)Skip confirmations

Examples

The nylas auth switch command changes which connected email account the CLI targets by default.

Switch interactively

nylas auth switch

Switch to a specific grant

nylas auth switch grant_abc123

Example output

✓ Switched active account
  Email:    bob@example.com
  Provider: microsoft
  Grant ID: grant_def456

Troubleshooting

No accounts to switch to

Run `nylas auth login` or `nylas auth config --api-key` to connect an account first.

Grant ID not recognized

Run `nylas auth list` to see valid grant IDs. Grant IDs are case-sensitive.

Recommended guides

Run nylas auth switch --help for full help output.