Algolia CLI / Get started

The Algolia Command-Line Interface (CLI) lets you manage your Algolia resources from the command line. It’s free and open source.

Before you start

Before you can use the Algolia CLI, you need to create a (free) Algolia account.

Install the Algolia CLI

You can download binaries for Linux and macOS, or install the Algolia CLI using a package manager. If you’re on Windows, you can use the Windows Subsystem for Linux (WSL) and install the Linux version of the Algolia CLI.

To install the Algolia CLI with Homebrew, run:

1
brew install algolia/algolia-cli/algolia

Add your first profile

To make accessing your Algolia resources easier, create a profile.

1
algolia profile add

This stores your Algolia application ID and the admin API key under a friendly name. You can find your application ID and API keys in the Algolia dashboard.

Explore

To make exploring the available commands easier, set up command completion for your shell.

To see all available commands of the Algolia CLI, run:

1
algolia

You should see output similar to:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
The official command-line tool to interact with Algolia.

Usage
  algolia <command> <subcommand> [flags]

Commands
  apikeys:     Manage your Algolia API keys
  completion:  Generate the autocompletion script for the specified shell
  help:        Help about any command
  indices:     Manage your Algolia indices
  objects:     Manage your indices' objects
  open:        Quickly open Algolia pages
  profile:     Manage your profiles
  rules:       Manage your Algolia rules
  search:      Search the given index
  settings:    Manage your Algolia settings
  synonyms:    Manage your Algolia synonyms

Flags
      --admin-api-key string    The admin API key
      --application-id string   The application ID
  -h, --help                    help for algolia
  -p, --profile string          The profile to use
  -v, --version                 Get the version of the Algolia CLI

Examples
  $ algolia search MY_INDEX --query "foo"
  $ algolia objects browse MY_INDEX
  $ algolia apikeys create --acl search
  $ algolia rules import MY_INDEX -f rules.json

Learn More
  Use 'algolia <command> <subcommand> --help' for more information about a command.
  Read the documentation at https://algolia.com/doc/tools/cli/

To find out more about a command, enter algolia <command>, for example, algolia profile. To see available options for a subcommand, add --help.

For example, to see the available options of the algolia profile add command, run:

1
algolia profile add --help

You should see output similar to:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
Add a new profile configuration to the CLI

Usage
  algolia profile add [flags]

Flags
      --app-id string   ID of the application.
  -d, --default         Set the profile as the default one.
  -h, --help            help for add
  -n, --name string     Name of the profile.

Inherited Flags
      --admin-api-key string    The admin API key
      --application-id string   The application ID
  -p, --profile string          The profile to use

Examples
  # Add a new profile (interactive)
  $ algolia profile add
  
  # Add a new profile (non-interactive) and set it to default
  $ algolia profile add --name "my-profile" --app-id "my-app-id" --admin-api-key "my-admin-api-key" --default

Learn More
  Use 'algolia <command> <subcommand> --help' for more information about a command.
  Read the documentation at https://algolia.com/doc/tools/cli/

Share feedback

To report bugs, make a feature request, or share feedback, open an issue in the Algolia CLI repository.

Did you find this page helpful?