Accounts switch

Open in

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 switch

Switch to a specific account by alias:

ably accounts switch work

Switch to a specific account by ID:

ably accounts switch VgQpOZ

Switch accounts and output the result in JSON format:

ably accounts switch --json

Switch accounts and output the result in formatted JSON:

ably accounts switch --pretty-json

See also

  • Accounts — Explore all ably accounts commands.
  • CLI reference — Full list of available commands.