# Algolia Cli

> >-

- **Type:** Skill
- **Install:** `agentstack add skill-algolia-skills-algolia-cli`
- **Verified:** Yes — security-reviewed for prompt injection and unsafe behavior
- **Seller:** [algolia](https://agentstack.voostack.com/s/algolia)
- **Installs:** 0
- **Category:** [Search](https://agentstack.voostack.com/c/search)
- **Latest version:** 0.1.0
- **License:** MIT
- **Upstream author:** [algolia](https://github.com/algolia)
- **Source:** https://github.com/algolia/skills/tree/main/skills/algolia-cli

## Install

```sh
agentstack add skill-algolia-skills-algolia-cli
```

Requires the [AgentStack CLI](https://agentstack.voostack.com/docs/cli). Works with Claude Code, Cursor, and any MCP-compatible agent.

## About

# Algolia CLI

Manage Algolia search infrastructure from the terminal using the `algolia` CLI.

## When to Use This Skill vs. algolia-mcp

| Need | Use |
|------|-----|
| Write/modify data (import, delete, update records) | **algolia-cli** (this skill) |
| Manage configuration (settings, rules, synonyms) | **algolia-cli** (this skill) |
| Auth (login, logout, signup via OAuth)                 | **algolia-cli** (this skill) |
| Admin operations (API keys, profiles, index copy/move) | **algolia-cli** (this skill) |
| Backup/restore indices | **algolia-cli** (this skill) |
| Search queries and view results | **algolia-mcp** |
| Analytics (top searches, click rates, no-results) | **algolia-mcp** |
| Recommendations (related products, trending) | **algolia-mcp** |

**Rule of thumb:** If the user wants to *read or analyze* data → algolia-mcp. If they want to *change, move, or manage* data → algolia-cli.

## Setup

Run `/algolia-cli:cli-setup` to install the CLI and configure a profile, or follow [Getting Started](references/getting-started.md).

**Tip:** `algolia auth login` is the easiest way to set up credentials — it handles OAuth sign-in and profile creation in one step. Use `algolia profile add` for non-interactive / CI setups where you already have an API key.

## Command Quick Reference

### Auth

| Task                        | Command                                            |
|-----------------------------|----------------------------------------------------|
| Sign in (opens browser)     | `algolia auth login`                               |
| Sign in (select app by name)| `algolia auth login --app-name "My App" --default` |
| Sign in (no browser / SSH)  | `algolia auth login --no-browser`                  |
| Sign out                    | `algolia auth logout`                              |
| Create new account          | `algolia auth signup`                              |

### Profile

| Task                          | Command                                                                            |
|-------------------------------|------------------------------------------------------------------------------------|
| Add profile (non-interactive) | `algolia profile add --name "default" --app-id "" --api-key "" --default` |
| List profiles                 | `algolia profile list`                                                             |
| Remove a profile              | `algolia profile remove "" -y`                                               |
| Set default profile           | `algolia profile setdefault ""`                                              |

### Application

| Task                              | Command                                                          |
|-----------------------------------|------------------------------------------------------------------|
| List applications                 | `algolia application list`                                       |
| Create application                | `algolia application create --name "My App" --region CA`         |
| Create (non-interactive, dry-run) | `algolia application create --name "My App" --region CA --dry-run` |
| Switch active application         | `algolia application select --app-name "My App"`                 |

### API Keys

| Task             | Command                                                                              |
|------------------|--------------------------------------------------------------------------------------|
| List API keys    | `algolia apikeys list`                                                               |
| Create API key   | `algolia apikeys create --acl search,browse --description "..." --indices "idx1,idx2"` |
| Get API key      | `algolia apikeys get `                                                          |
| Delete API key   | `algolia apikeys delete  -y`                                                    |

### Search

| Task                | Command                                                              |
|---------------------|----------------------------------------------------------------------|
| Search an index     | `algolia search  --query ""`                           |
| Search with filters | `algolia search  --query "" --filters ""`      |
| Paginated search    | `algolia search  --query "" --hitsPerPage 10 --page 2` |

### Indices

| Task                          | Command                                                |
|-------------------------------|--------------------------------------------------------|
| List all indices              | `algolia indices list`                                 |
| Delete an index               | `algolia indices delete  -y`                    |
| Clear records (keep settings) | `algolia indices clear  -y`                     |
| Copy index                    | `algolia indices copy   -y`                  |
| Copy only settings            | `algolia indices copy   --scope settings -y` |
| Move/rename index             | `algolia indices move   -y`                  |

### Objects (Records)

| Task                       | Command                                                             |
|----------------------------|---------------------------------------------------------------------|
| Browse all records         | `algolia objects browse `                                    |
| Browse specific attributes | `algolia objects browse  --attributesToRetrieve title,price` |
| Import records from file   | `algolia objects import  -F data.ndjson`                     |
| Import from stdin          | `cat data.ndjson \| algolia objects import  -F -`            |
| Delete by IDs              | `algolia objects delete  --object-ids id1,id2 -y`            |
| Delete by filter           | `algolia objects delete  --filters "type:obsolete" -y`       |
| Partial update             | `algolia objects update  -F updates.ndjson`                  |

### Settings

| Task                           | Command                                                |
|--------------------------------|--------------------------------------------------------|
| Get settings                   | `algolia settings get `                         |
| Set a setting                  | `algolia settings set  --typoTolerance="false"` |
| Import settings from file      | `algolia settings import  -F settings.json`     |
| Import and forward to replicas | `algolia settings import  -F settings.json -f`  |

### Rules

| Task               | Command                                              |
|--------------------|------------------------------------------------------|
| Browse all rules   | `algolia rules browse `                       |
| Import rules       | `algolia rules import  -F rules.ndjson -y`    |
| Replace all rules  | `algolia rules import  -F rules.ndjson -c -y` |
| Delete rules by ID | `algolia rules delete  --rule-ids id1,id2 -y` |

### Synonyms

| Task                  | Command                                                        |
|-----------------------|----------------------------------------------------------------|
| Browse all synonyms   | `algolia synonyms browse `                              |
| Import synonyms       | `algolia synonyms import  -F synonyms.ndjson`           |
| Replace all synonyms  | `algolia synonyms import  -F synonyms.ndjson -r`        |
| Delete synonyms by ID | `algolia synonyms delete  --synonym-ids id1,id2 -y`     |
| Save a single synonym | `algolia synonyms save  --id my-syn --synonyms foo,bar` |

### Crawler

| Task                          | Command                                                                 |
|-------------------------------|-------------------------------------------------------------------------|
| List crawlers                 | `algolia crawler list`                                                  |
| List by app                   | `algolia crawler list --app-id `                                |
| Get crawler details           | `algolia crawler get `                                              |
| Get config only               | `algolia crawler get  --config-only`                                |
| Create crawler                | `algolia crawler create  -F config.json`                          |
| Start/resume crawler          | `algolia crawler run `                                              |
| Pause crawler(s)              | `algolia crawler pause  [ ...]`                                |
| Reindex crawler(s)            | `algolia crawler reindex  [ ...]`                              |
| Unblock crawler               | `algolia crawler unblock  -y`                                       |
| Crawl specific URLs           | `algolia crawler crawl  --urls url1,url2`                           |
| Test URL against crawler      | `algolia crawler test  --url `                                 |
| Test with config override     | `algolia crawler test  --url  -F config.json`                  |
| Get crawl statistics          | `algolia crawler stats `                                            |

Most crawler commands support `--dry-run` to preview the request without sending it: `create`, `run`, `pause`, `reindex`, `unblock`, `test`.

**Auth:** Crawler commands require `ALGOLIA_CRAWLER_USER_ID` and `ALGOLIA_CRAWLER_API_KEY` env vars, or `crawler_user_id`/`crawler_api_key` in the profile config file.

## Synonym Type Guide

Choosing the right synonym type matters for search quality:

- **`synonym` (regular/two-way):** All terms are interchangeable. Use when the words truly mean the same thing in both directions.
  Example: "sneakers" ↔ "trainers" — searching either should find the other.
- **`oneWaySynonym`:** Only the `input` term expands to include the `synonyms`, not the reverse. Use when a short/abbreviated term should match longer/specific terms, but not vice versa.
  Example: "TV" → "television", "flat screen" — searching "TV" finds "television" results, but searching "television" does NOT return "TV" results.

**Rule of thumb:** If the user says "searching X should *also match* Y", that's one-way (`input: X`, `synonyms: [Y]`). If they say "X and Y should be equivalent/interchangeable", that's two-way.

### Describe

| Task                       | Command                          |
|----------------------------|----------------------------------|
| Describe root command tree | `algolia describe`               |
| Describe a command         | `algolia describe search`        |
| Describe a subcommand      | `algolia describe objects browse` |

## Key Conventions

1. **Always use non-interactive mode.** Destructive commands need `-y` (or `--confirm`) to skip confirmation prompts. This includes `objects delete`, `indices delete/clear/copy/move`, `rules import/delete`, `synonyms delete`, and `apikeys delete`. Without `-y`, the CLI will hang waiting for user input. Note: `objects import`, `objects update`, and `synonyms import` do **not** have a `-y` flag — they run non-interactively by default.
2. **ndjson format.** `objects browse`, `objects import`, `rules browse/import`, and `synonyms browse/import` use newline-delimited JSON (one JSON object per line), **not** JSON arrays.
3. **Profile flag.** Use `-p ` to target a non-default profile. Omit it to use the default.
4. **Credential precedence.** Environment variables override all other configuration. The resolution order is: **env vars** > **CLI flags** (`--application-id`, `--api-key`) > **profile config file** > **default profile**. Supported env vars: `ALGOLIA_APPLICATION_ID`, `ALGOLIA_API_KEY`, `ALGOLIA_ADMIN_API_KEY`, `ALGOLIA_SEARCH_HOSTS`, `ALGOLIA_CRAWLER_USER_ID`, `ALGOLIA_CRAWLER_API_KEY`. If env vars are set, `--profile`/`-p` is ignored for those credentials.
5. **Wait flag.** Use `-w` (or `--wait`) when subsequent commands depend on the operation completing (e.g., import then search).
6. **Pipe between commands.** Copy data across indices: `algolia objects browse SRC | algolia objects import DST -F -`
7. **JSON output.** Use `--output json` (or `-o json`) when you need machine-readable output.

## Common Workflows

### Migrate records between indices (with field filtering)
```bash
algolia objects browse SOURCE --attributesToRetrieve objectID,title,price \
  | algolia objects import DEST -F - -w
```

### Full index backup
```bash
algolia objects browse MY_INDEX > my_index_records.ndjson
algolia settings get MY_INDEX > my_index_settings.json
algolia rules browse MY_INDEX > my_index_rules.ndjson
algolia synonyms browse MY_INDEX > my_index_synonyms.ndjson
```
Note: settings use `.json` (standard JSON), everything else uses `.ndjson` (newline-delimited JSON).

### Restore from backup
```bash
algolia objects import MY_INDEX -F my_index_records.ndjson -w
algolia settings import MY_INDEX -F my_index_settings.json -w
algolia rules import MY_INDEX -F my_index_rules.ndjson -c -y -w
algolia synonyms import MY_INDEX -F my_index_synonyms.ndjson -r -w
```

## Direct Invocation

If the skill doesn't trigger automatically, users can invoke it directly:

- **`/algolia-cli`** — Load the full skill into context for any Algolia CLI task
- **`/algolia-cli:cli-setup`** — Install the CLI and configure a profile

This is useful when the request is brief (e.g., "import my data into Algolia") and the skill might not auto-trigger.

## Reference Docs

- [Getting Started](references/getting-started.md) — Installation and profile setup
- [Command Reference](references/commands.md) — Full syntax, flags, and examples for every command

## Source & license

This open-source skill is cataloged on AgentStack and links to its original source — we do not rehost the code.

- **Author:** [algolia](https://github.com/algolia)
- **Source:** [algolia/skills](https://github.com/algolia/skills)
- **License:** MIT

Install and usage instructions live in the source repository linked above.

## Pricing

- **Free** — Free

## Security capabilities

Automated source analysis of v0.1.0 — what this tool can access:

- **Network access:** no
- **Filesystem access:** no
- **Shell / process execution:** no
- **Environment & secrets:** no
- **Dynamic code execution:** no

*"Yes" means the capability is present in the source — more access means more to trust, not that it is unsafe.*


## Versions

- **0.1.0** — security scan: passed — Imported from the upstream source.

## Links

- Listing page: https://agentstack.voostack.com/l/skill-algolia-skills-algolia-cli
- Seller: https://agentstack.voostack.com/s/algolia
- Browse the marketplace: https://agentstack.voostack.com/browse

---
Listed on AgentStack — the marketplace for AI agent skills and MCP servers. Every listing is security-reviewed. Creators keep 70%.
