Login

Open in

Use the ably 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 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 login

Log in and set an alias for the account:

ably login --alias work

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

ably login --no-browser

Log in and output the result in JSON format:

ably login --json

Log in and output the result in formatted JSON:

ably login --pretty-json

See also