Skip to main content
This page explains how to use the Algolia CLI in automation, including non-interactive behavior, structured output, run summaries, and dry runs. To learn more about interactive use, see Get started.

Credentials in automation

For environment variables, profiles, command-line flags, precedence, and Crawler keys, see Authenticate CLI commands. Automation-focused choices:
  • CI and other servers: Use ALGOLIA_APPLICATION_ID and ALGOLIA_API_KEY from your platform’s secret store so keys don’t end up in version control or config files.
  • **Local machines, including frequent CLI use by agents: Use profiles to avoid entering credentials for every command and to keep them out of shell history.
  • One-off commands or temporary overrides: --application-id and --api-key can target a different Algolia application or API key for one command. On native Windows, these flags aren’t supported. Use environment variables or profiles instead. See Command-line options.

Non-interactive runs

In non-interactive environments, such as CI/CD, pipes, and agent workflows, the CLI doesn’t prompt for confirmation. Commands that delete or replace existing data require confirmation. To run these commands in a non-interactive environment, pass --confirm. Otherwise, the command exits with an error.

Structured output and command metadata

  • JSON output. To keep standard output machine-readable, use -o json, -o jsonl, or -o ndjson where supported.
  • Command schema. To help agents understand a command without parsing --help, run algolia describe <command>. This prints JSON metadata for the command, including flags and response fields.

Exit codes

The Algolia CLI uses the following conventions for exit code. Use them in scripts and CI to handle command outcomes programmatically.
CodeMeaning
0Success
1Error
2User cancelled
4Auth error

Pipe data into the CLI

To import data from another command or script, use -F - to read from standard input. Supported commands accept NDJSON or line-delimited JSON, depending on the command.
Command line
cat records.ndjson | algolia objects import INDEX_NAME -F -

Observability

Telemetry

By default the CLI sends usage analytics. Opt out with ALGOLIA_CLI_TELEMETRY=0. For details, see Telemetry.

Debug logging

Set DEBUG=1 (or any non-empty value) to print additional error details to stderr for telemetry and update notifier issues. For more information, see Telemetry.

Dry runs

To validate changes without applying them, use --dry-run. To get a structured preview, combine it with -o json. Supported for these commands:
Command areaExamples
Applicationalgolia application create
Crawleralgolia crawler create, pause, reindex, run, test, unblock
Dictionaryalgolia dictionary entries import
Indicesalgolia indices delete
Objectsalgolia objects update, operations, delete
Rulesalgolia rules import
Synonymsalgolia synonyms import
Command line
algolia objects update INDEX_NAME -F records.ndjson --dry-run --output json
The output typically includes "dryRun": true and preview fields. The exact output depends on the command.

Use llms.txt for agent navigation

Algolia provides llms.txt files that help agents discover resources.

Environment variables (quick reference)

VariableEffect
ALGOLIA_CLI_TELEMETRY=0Opt out of telemetry
ALGOLIA_NO_UPDATE_NOTIFIERSkip update checks when set to any value
DEBUG=1Enable debug output on stderr when set to any non-empty value
Last modified on April 22, 2026