Skip to main content
Every CLI command that communicates with Algolia requires authentication. We recommend signing in with OAuth, which stores your credentials automatically. Alternatively, provide your Algolia application ID and API key with environment variables or command-line flags.
In general, use an API key with minimal permissions, just enough to run the commands you want to run. For more information, see API keys.

Sign in with OAuth

Signing in with OAuth is the quickest way to get started. The CLI stores your credentials for you, so you don’t need to copy or manage API keys.
This opens the Algolia dashboard in your browser so you can sign in or create a new account. After you sign in, the CLI stores your credentials in your system keychain.
To directly create a new account, use algolia auth signup.
If you’re running the CLI in an environment without a browser, such as an SSH session or container, add --no-browser. The CLI prints an authorization URL and waits for you to complete the sign-in process. After signing in, select the application for your commands:
This command creates a local profile for the selected application if one doesn’t already exist and sets it as the default. The profile stores an API key that the CLI uses for subsequent commands, so you don’t need to pass --application-id or --api-key. To select an application without an interactive prompt, use --app-name.

Authentication commands

To see a list of available authentication commands, see algolia auth.

Provide credentials directly

For CI pipelines, scripts, or if you prefer to manage credentials yourself, provide your application ID and API key instead of signing in. You can find both in the Algolia dashboard.

Environment variables

Set these environment variables:
  • ALGOLIA_APPLICATION_ID
  • ALGOLIA_API_KEY
Environment variables take precedence over command-line options and profiles. That means you can’t switch profiles while using environment variables.

Command-line options

Provide these options when running commands:
  • --application-id
  • --api-key
Command-line options take precedence over profiles.
These options are supported on macOS, Linux, and Windows Subsystem for Linux (WSL). They’re ignored in the native Windows build of the Algolia CLI.

Profiles

Profiles store an application ID and API key under a friendly name in ~/.config/algolia/config.toml.
The --profile flag is deprecated. Sign in with algolia auth login and select an application with algolia application select instead.algolia application select manages the profile and API key for you.
You can still refer to a profile with the --profile option, for example: algolia indices list -p PROFILE_NAME. See algolia profile for the deprecated profile commands.
Profiles are stored in plain text in the file ~/.config/algolia/config.toml. If you manage your configuration files (“dotfiles”) with GitHub, don’t commit this file.

Crawler credentials

Crawler commands require separate Crawler API credentials. Configure them in one of the following ways.

Configure the Crawler API key after signing in

If you’ve signed in with OAuth and selected an application, run:
This fetches your Crawler API key for the current application and stores it securely in your operating system’s keychain. You don’t need to copy the key from the Algolia dashboard.

Crawler environment variables

Export your Crawler user ID and Crawler API key as environment variables: ALGOLIA_CRAWLER_USER_ID and ALGOLIA_CRAWLER_API_KEY. You can find both in the Algolia dashboard:
  1. Go to the Algolia dashboard and select your Algolia application.
  2. On the left sidebar, select Data sources.
  3. Select Crawler and go to the Settings tab.

Crawler profiles

Like the --profile flag, manually managed crawler profiles are deprecated. Configure the Crawler API key with algolia auth crawler instead.
Add the keys crawler_user_id and crawler_api_key to an application profile in ~/.config/algolia/config.toml. An example profile for an Algolia application with Crawler could look like the following:
Last modified on July 14, 2026