KosmoKrator

search

Algolia CLI for AI Agents

Use the Algolia CLI from KosmoKrator to call Algolia tools headlessly, return JSON, inspect schemas, and automate workflows from coding agents, scripts, and CI.

10 functions 5 read 5 write API key auth

Algolia CLI Setup

Algolia can be configured headlessly with `kosmokrator integrations:configure algolia`.

# Install KosmoKrator first if it is not available on PATH.
curl -fsSL https://raw.githubusercontent.com/OpenCompanyApp/kosmokrator/main/install.sh | bash

# Configure and verify this integration.
kosmokrator integrations:configure algolia --set app_id="$ALGOLIA_APP_ID" --set api_key="$ALGOLIA_API_KEY" --enable --read allow --write ask --json
kosmokrator integrations:doctor algolia --json
kosmokrator integrations:status --json

Credentials

Authentication type: API key api_key. Configure credentials once, then use the same stored profile from scripts, coding CLIs, Lua code mode, and the MCP gateway.

KeyEnv varTypeRequiredLabel
app_id ALGOLIA_APP_ID Text text yes Application ID
api_key ALGOLIA_API_KEY Secret secret yes Admin API Key

Call Algolia Headlessly

Use the generic call form when another coding CLI or script needs a stable universal interface.

kosmo integrations:call algolia.algolia_search '{
  "indexName": "example_indexName",
  "query": "example_query",
  "filters": "example_filters",
  "hitsPerPage": 1,
  "page": 1,
  "attributesToRetrieve": "example_attributesToRetrieve",
  "facets": "example_facets",
  "facetFilters": "example_facetFilters"
}' --json

Use the provider shortcut form for shorter human-facing commands.

kosmo integrations:algolia algolia_search '{
  "indexName": "example_indexName",
  "query": "example_query",
  "filters": "example_filters",
  "hitsPerPage": 1,
  "page": 1,
  "attributesToRetrieve": "example_attributesToRetrieve",
  "facets": "example_facets",
  "facetFilters": "example_facetFilters"
}' --json

Agent Discovery Commands

These commands return structured output for coding agents that need to inspect capabilities before choosing a function.

kosmo integrations:docs algolia --json
kosmo integrations:docs algolia.algolia_search --json
kosmo integrations:schema algolia.algolia_search --json
kosmo integrations:search "Algolia" --json
kosmo integrations:list --json

All CLI Functions

Every function below can be called headlessly. The generic form is stable across all integrations; the provider shortcut is shorter but specific to Algolia.

algolia.algolia_get_object

Read read

Retrieve a single record from an Algolia index by its objectID. Returns all attributes of the object.

Parameters
indexName, objectID, attributesToRetrieve

Generic CLI call

kosmo integrations:call algolia.algolia_get_object '{"indexName":"example_indexName","objectID":"example_objectID","attributesToRetrieve":"example_attributesToRetrieve"}' --json

Provider shortcut

kosmo integrations:algolia algolia_get_object '{"indexName":"example_indexName","objectID":"example_objectID","attributesToRetrieve":"example_attributesToRetrieve"}' --json

algolia.algolia_save_object

Write write

Create or replace a record in an Algolia index. The object is identified by its objectID. If a record with this objectID exists, it will be fully replaced.

Parameters
indexName, objectID, body

Generic CLI call

kosmo integrations:call algolia.algolia_save_object '{"indexName":"example_indexName","objectID":"example_objectID","body":"example_body"}' --json

Provider shortcut

kosmo integrations:algolia algolia_save_object '{"indexName":"example_indexName","objectID":"example_objectID","body":"example_body"}' --json

algolia.algolia_delete_object

Write write

Delete a record from an Algolia index by its objectID. This action is irreversible.

Parameters
indexName, objectID

Generic CLI call

kosmo integrations:call algolia.algolia_delete_object '{"indexName":"example_indexName","objectID":"example_objectID"}' --json

Provider shortcut

kosmo integrations:algolia algolia_delete_object '{"indexName":"example_indexName","objectID":"example_objectID"}' --json

algolia.algolia_partial_update

Write write

Update specific attributes of a record without replacing the entire object. Only the specified attributes will be changed; all other attributes remain unchanged.

Parameters
indexName, objectID, attributes

Generic CLI call

kosmo integrations:call algolia.algolia_partial_update '{"indexName":"example_indexName","objectID":"example_objectID","attributes":"example_attributes"}' --json

Provider shortcut

kosmo integrations:algolia algolia_partial_update '{"indexName":"example_indexName","objectID":"example_objectID","attributes":"example_attributes"}' --json

algolia.algolia_list_indices

Read read

List all indices in the Algolia application. Returns index names, entry counts, and sizes information.

Parameters
page, hitsPerPage

Generic CLI call

kosmo integrations:call algolia.algolia_list_indices '{"page":1,"hitsPerPage":1}' --json

Provider shortcut

kosmo integrations:algolia algolia_list_indices '{"page":1,"hitsPerPage":1}' --json

algolia.algolia_get_settings

Read read

Get the configuration settings of an Algolia index, including searchable attributes, ranking, facets, and more.

Parameters
indexName

Generic CLI call

kosmo integrations:call algolia.algolia_get_settings '{"indexName":"example_indexName"}' --json

Provider shortcut

kosmo integrations:algolia algolia_get_settings '{"indexName":"example_indexName"}' --json

algolia.algolia_clear_index

Write write

Remove all records from an Algolia index. The index itself is preserved with its settings. This action is irreversible.

Parameters
indexName

Generic CLI call

kosmo integrations:call algolia.algolia_clear_index '{"indexName":"example_indexName"}' --json

Provider shortcut

kosmo integrations:algolia algolia_clear_index '{"indexName":"example_indexName"}' --json

algolia.algolia_batch

Write write

Perform multiple write operations (addObject, updateObject, partialUpdateObject, deleteObject) in a single batch request for better performance.

Parameters
indexName, requests

Generic CLI call

kosmo integrations:call algolia.algolia_batch '{"indexName":"example_indexName","requests":"example_requests"}' --json

Provider shortcut

kosmo integrations:algolia algolia_batch '{"indexName":"example_indexName","requests":"example_requests"}' --json

algolia.algolia_get_current_user

Read read

List API keys for the Algolia application. Use this to verify that authentication is working and to see which API keys exist.

Parameters
none

Generic CLI call

kosmo integrations:call algolia.algolia_get_current_user '{}' --json

Provider shortcut

kosmo integrations:algolia algolia_get_current_user '{}' --json

Function Schemas

Use these parameter tables when building CLI payloads without calling integrations:schema first.

algolia.algolia_get_object

Retrieve a single record from an Algolia index by its objectID. Returns all attributes of the object.

Operation
Read read
Schema command
kosmo integrations:schema algolia.algolia_get_object --json
ParameterTypeRequiredDescription
indexName string yes The name of the index.
objectID string yes The unique identifier of the record.
attributesToRetrieve array no List of attributes to include in the response. Default: all attributes.

algolia.algolia_save_object

Create or replace a record in an Algolia index. The object is identified by its objectID. If a record with this objectID exists, it will be fully replaced.

Operation
Write write
Schema command
kosmo integrations:schema algolia.algolia_save_object --json
ParameterTypeRequiredDescription
indexName string yes The name of the index.
objectID string yes The unique identifier for the record.
body object yes The complete record data. Must include all attributes you want stored. The objectID will be set automatically.

algolia.algolia_delete_object

Delete a record from an Algolia index by its objectID. This action is irreversible.

Operation
Write write
Schema command
kosmo integrations:schema algolia.algolia_delete_object --json
ParameterTypeRequiredDescription
indexName string yes The name of the index.
objectID string yes The unique identifier of the record to delete.

algolia.algolia_partial_update

Update specific attributes of a record without replacing the entire object. Only the specified attributes will be changed; all other attributes remain unchanged.

Operation
Write write
Schema command
kosmo integrations:schema algolia.algolia_partial_update --json
ParameterTypeRequiredDescription
indexName string yes The name of the index.
objectID string yes The unique identifier of the record to update.
attributes object yes Key-value pairs of attributes to update. Only the specified attributes will be changed. Use special operations like {"_operation":"Increment","value":1} for atomic updates.

algolia.algolia_list_indices

List all indices in the Algolia application. Returns index names, entry counts, and sizes information.

Operation
Read read
Schema command
kosmo integrations:schema algolia.algolia_list_indices --json
ParameterTypeRequiredDescription
page integer no Page number for pagination (0-based). Default: 0.
hitsPerPage integer no Number of indices per page. Default: 100.

algolia.algolia_get_settings

Get the configuration settings of an Algolia index, including searchable attributes, ranking, facets, and more.

Operation
Read read
Schema command
kosmo integrations:schema algolia.algolia_get_settings --json
ParameterTypeRequiredDescription
indexName string yes The name of the index.

algolia.algolia_clear_index

Remove all records from an Algolia index. The index itself is preserved with its settings. This action is irreversible.

Operation
Write write
Schema command
kosmo integrations:schema algolia.algolia_clear_index --json
ParameterTypeRequiredDescription
indexName string yes The name of the index to clear.

algolia.algolia_batch

Perform multiple write operations (addObject, updateObject, partialUpdateObject, deleteObject) in a single batch request for better performance.

Operation
Write write
Schema command
kosmo integrations:schema algolia.algolia_batch --json
ParameterTypeRequiredDescription
indexName string yes The name of the index.
requests array yes Array of batch operations. Each request must have "action" (addObject, updateObject, partialUpdateObject, deleteObject) and "body" (the record data). For update/delete, body must include "objectID".

algolia.algolia_get_current_user

List API keys for the Algolia application. Use this to verify that authentication is working and to see which API keys exist.

Operation
Read read
Schema command
kosmo integrations:schema algolia.algolia_get_current_user --json
ParameterTypeRequiredDescription
No parameters.

Permissions

Headless calls still follow the integration read/write permission policy. Configure read/write defaults with integrations:configure. Add --force only for trusted automation that should bypass that policy.