Skip to main content
To run commands against your Algolia application, the CLI needs your credentials. Sign in with OAuth and the CLI stores your credentials for you. You can also provide your application ID and API key with environment variables or command-line flags. The CLI uses credentials in this order:
  1. Environment variables
  2. Command-line flags
  3. The application you selected when you signed in or ran algolia application select
  4. Profiles in config.toml (deprecated)

Sign in with OAuth

Sign in with OAuth so the CLI manages your credentials for you. You don’t need to copy or manage API keys.
This opens the Algolia dashboard in your browser so you can sign in. To create a new account, run algolia auth signup. After you sign in, select an application. If you don’t have an application, the CLI creates one. The CLI sets this application as your current application. To switch applications later, run algolia application select. To select an application without an interactive prompt, use --app-name. The CLI also prints the sign-in URL and waits until you complete the sign-in. To print the URL and not open a browser, add --no-browser. For example, use this flag when an agent runs the CLI. Open the URL on the same machine, because the CLI waits for a redirect to localhost. On machines without a browser, such as CI servers, provide credentials directly instead. To sign in without prompts, such as in a script or an agent workflow, run algolia auth login --non-interactive. The CLI prints JSON and doesn’t configure an application unless you pass --app-name. For more information, see Use the CLI in automation. The CLI stores your sign-in session and the application’s API key in your system keychain. It stores your current application and its alias in state.toml, in the same folder as config.toml. The API key has read and write ACLs, such as search, addObject, and editSettings. To use a key with fewer permissions, see Provide credentials directly. To check your sign-in and current application, run algolia auth status. For the full list of 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.
Use an API key that has only the ACLs that your commands need. Before the CLI runs a command, it checks the ACLs of the key. If the key doesn’t have an ACL that the command needs, the command fails with Missing API key ACL(s).

Environment variables

Set these environment variables:
  • ALGOLIA_APPLICATION_ID
  • ALGOLIA_API_KEY
Environment variables take precedence over all other credentials. If you set these variables, you can’t switch applications or profiles.

Command-line flags

To provide credentials for one command, add these flags to the command:
  • --application-id
  • --api-key
These flags work on macOS, Linux, and Windows Subsystem for Linux (WSL). The native Windows build of the Algolia CLI ignores them.

Crawler credentials

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

Get the Crawler API key after you sign in

If you’ve signed in with OAuth and selected an application, run:
This command gets the Crawler API key for your current application. The CLI stores the key in the keychain of your operating system. 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. To use a crawler profile, add crawler_user_id and crawler_api_key to an application profile in config.toml:

Profiles

Profiles are the legacy way to store credentials. Each named profile stores an application ID and an API key in config.toml. This file is in ~/.config/algolia. If you set XDG_CONFIG_HOME, the file is in $XDG_CONFIG_HOME/algolia. When you sign in with OAuth, the CLI doesn’t store credentials in this file. The --profile flag is deprecated. Sign in with algolia auth login and select an application with algolia application select instead. To use a profile, add the --profile flag or its shorthand -p to a command, for example: algolia indices list -p PROFILE_NAME. For the deprecated profile commands, see algolia profile.
If you manage your configuration files (“dotfiles”) with Git, don’t commit config.toml. The CLI stores profiles in plain text, so anyone with access to the repository can read your API keys.
Last modified on November 20, 2026