Accounts login

Open in

Use the ably accounts login command to log in to your Ably account via OAuth. The CLI opens a browser, you authorize the request, and tokens are stored locally and auto-refreshed.

If your account has multiple accounts, apps, or API keys, the CLI prompts you to pick one.

Synopsis

ably accounts login [options]

Options

--alias | -a

Set an alias name for this account so you can switch between multiple accounts using ably accounts switch. If omitted, the CLI generates one from the account name.

--no-browser

Prevent the CLI from automatically opening a browser. The CLI displays the verification URL and user code to open manually.

--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

Log in to your Ably account using the browser:

ably accounts login

Log in and set an alias for the account:

ably accounts login --alias work

Log in without opening a browser (for use over SSH or in headless environments):

ably accounts login --no-browser

Log in and output the result in JSON format:

ably accounts login --json

Log in and output the result in formatted JSON:

ably accounts login --pretty-json

See also

  • Accounts — Explore all ably accounts commands.
  • Environment variables — Authenticate via environment variables instead of using OAuth login.
  • CLI reference — Full list of available commands.