Use the ably accounts switch command to switch to a different locally configured Ably account. If no alias or ID is provided, the CLI presents an interactive list of available accounts.
Synopsis
ably accounts switch [account-alias-or-id] [options]Arguments
account-alias-or-id
An optional account alias or ID to switch to. If not provided, the CLI displays an interactive prompt to select from available accounts.
Options
--json
Output results as compact JSON. Mutually exclusive with --pretty-json.
--pretty-json
Output results in formatted JSON. Mutually exclusive with --json.
--verbose | -v
Enable verbose logging. Can be combined with --json or --pretty-json.
Examples
Switch accounts interactively:
ably accounts switchSwitch to a specific account by alias:
ably accounts switch workSwitch to a specific account by ID:
ably accounts switch VgQpOZSwitch accounts and output the result in JSON format:
ably accounts switch --jsonSwitch accounts and output the result in formatted JSON:
ably accounts switch --pretty-jsonSee also
- Accounts — Explore all
ably accountscommands. - CLI reference — Full list of available commands.