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.--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:
--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, seealgolia 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_IDALGOLIA_API_KEY
Command-line options
Provide these options when running commands:--application-id--api-key
Profiles
Profiles store an application ID and API key under a friendly name in~/.config/algolia/config.toml.
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: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:
- Go to the Algolia dashboard and select your Algolia application.
- On the left sidebar, select Data sources.
- Select Crawler and go to the Settings tab.
Crawler profiles
Add the keyscrawler_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: