Algolia CLI / Overview

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.

To install the Algolia CLI with Homebrew, run:

1
brew install algolia/algolia-cli/algolia

Add your first profile

To make authentication with Algolia and accessing your resources easier, you should create a profile.

1
algolia profile add

You need to enter a name for the profile, the Algolia application ID, and the Admin API key. You can find both in the Algolia dashboard.

Explore

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

Run the command algolia to see a list of available commands.

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
35
$ algolia                              
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/

If you want to find out more about a specific command, enter algolia <command>, for example, algolia profile. To see available options for a given sub-command, add the --help option. For example, to see the available options of the algolia profile add command, enter:

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
$ algolia profile add --help
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)
  $ 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/

Send us 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?