KosmoKrator

other

Meilisearch CLI for AI Agents

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

7 functions 5 read 2 write API key auth

Meilisearch CLI Setup

Meilisearch can be configured headlessly with `kosmokrator integrations:configure meilisearch`.

# 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 meilisearch --set api_key="$MEILISEARCH_API_KEY" --enable --read allow --write ask --json
kosmokrator integrations:doctor meilisearch --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
api_key MEILISEARCH_API_KEY Secret secret yes API Key
url MEILISEARCH_URL URL url no Meilisearch URL

Call Meilisearch Headlessly

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

kosmo integrations:call meilisearch.meilisearch_list_indexes '{
  "limit": 1,
  "offset": 1
}' --json

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

kosmo integrations:meilisearch meilisearch_list_indexes '{
  "limit": 1,
  "offset": 1
}' --json

Agent Discovery Commands

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

kosmo integrations:docs meilisearch --json
kosmo integrations:docs meilisearch.meilisearch_list_indexes --json
kosmo integrations:schema meilisearch.meilisearch_list_indexes --json
kosmo integrations:search "Meilisearch" --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 Meilisearch.

meilisearch.meilisearch_list_indexes

Read read

List all indexes in the Meilisearch instance. Returns index UIDs, primary keys, and creation dates.

Parameters
limit, offset

Generic CLI call

kosmo integrations:call meilisearch.meilisearch_list_indexes '{"limit":1,"offset":1}' --json

Provider shortcut

kosmo integrations:meilisearch meilisearch_list_indexes '{"limit":1,"offset":1}' --json

meilisearch.meilisearch_get_index

Read read

Get detailed information about a specific Meilisearch index, including its UID, primary key, and stats.

Parameters
uid

Generic CLI call

kosmo integrations:call meilisearch.meilisearch_get_index '{"uid":"example_uid"}' --json

Provider shortcut

kosmo integrations:meilisearch meilisearch_get_index '{"uid":"example_uid"}' --json

meilisearch.meilisearch_create_index

Write write

Create a new index in Meilisearch. Returns a task object that can be used to track the creation progress.

Parameters
uid, primary_key

Generic CLI call

kosmo integrations:call meilisearch.meilisearch_create_index '{"uid":"example_uid","primary_key":"example_primary_key"}' --json

Provider shortcut

kosmo integrations:meilisearch meilisearch_create_index '{"uid":"example_uid","primary_key":"example_primary_key"}' --json

meilisearch.meilisearch_search_documents

Read read

Search for documents in a Meilisearch index. Supports full-text search with filters, sorting, and pagination.

Parameters
index_uid, q, limit, offset, filter, sort

Generic CLI call

kosmo integrations:call meilisearch.meilisearch_search_documents '{"index_uid":"example_index_uid","q":"example_q","limit":1,"offset":1,"filter":"example_filter","sort":"example_sort"}' --json

Provider shortcut

kosmo integrations:meilisearch meilisearch_search_documents '{"index_uid":"example_index_uid","q":"example_q","limit":1,"offset":1,"filter":"example_filter","sort":"example_sort"}' --json

meilisearch.meilisearch_add_documents

Write write

Add or replace documents in a Meilisearch index. Sends an array of document objects to be indexed. Returns a task object to track progress.

Parameters
index_uid, documents, primary_key

Generic CLI call

kosmo integrations:call meilisearch.meilisearch_add_documents '{"index_uid":"example_index_uid","documents":"example_documents","primary_key":"example_primary_key"}' --json

Provider shortcut

kosmo integrations:meilisearch meilisearch_add_documents '{"index_uid":"example_index_uid","documents":"example_documents","primary_key":"example_primary_key"}' --json

meilisearch.meilisearch_get_document

Read read

Retrieve a single document from a Meilisearch index by its primary key value.

Parameters
index_uid, doc_id

Generic CLI call

kosmo integrations:call meilisearch.meilisearch_get_document '{"index_uid":"example_index_uid","doc_id":"example_doc_id"}' --json

Provider shortcut

kosmo integrations:meilisearch meilisearch_get_document '{"index_uid":"example_index_uid","doc_id":"example_doc_id"}' --json

meilisearch.meilisearch_get_health

Read read

Check the health status of the Meilisearch instance. Returns whether the server is available and operational.

Parameters
none

Generic CLI call

kosmo integrations:call meilisearch.meilisearch_get_health '{}' --json

Provider shortcut

kosmo integrations:meilisearch meilisearch_get_health '{}' --json

Function Schemas

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

meilisearch.meilisearch_list_indexes

List all indexes in the Meilisearch instance. Returns index UIDs, primary keys, and creation dates.

Operation
Read read
Schema command
kosmo integrations:schema meilisearch.meilisearch_list_indexes --json
ParameterTypeRequiredDescription
limit integer no Maximum number of indexes to return (default: 20).
offset integer no Number of indexes to skip for pagination.

meilisearch.meilisearch_get_index

Get detailed information about a specific Meilisearch index, including its UID, primary key, and stats.

Operation
Read read
Schema command
kosmo integrations:schema meilisearch.meilisearch_get_index --json
ParameterTypeRequiredDescription
uid string yes The index unique identifier (e.g., "movies").

meilisearch.meilisearch_create_index

Create a new index in Meilisearch. Returns a task object that can be used to track the creation progress.

Operation
Write write
Schema command
kosmo integrations:schema meilisearch.meilisearch_create_index --json
ParameterTypeRequiredDescription
uid string yes The unique identifier for the new index (e.g., "movies").
primary_key string no The primary key field for the index (e.g., "id"). Optional — can be set later.

meilisearch.meilisearch_search_documents

Search for documents in a Meilisearch index. Supports full-text search with filters, sorting, and pagination.

Operation
Read read
Schema command
kosmo integrations:schema meilisearch.meilisearch_search_documents --json
ParameterTypeRequiredDescription
index_uid string yes The index unique identifier to search in (e.g., "movies").
q string no The search query string. Use empty string "" to return all documents.
limit integer no Maximum number of documents to return (default: 20).
offset integer no Number of documents to skip for pagination.
filter string no Filter expression as a JSON string, e.g., '[["genre = Comedy"]]'.
sort array no Sort criteria as an array of strings, e.g., ["price:asc"]. Requires a sortable attribute.

meilisearch.meilisearch_add_documents

Add or replace documents in a Meilisearch index. Sends an array of document objects to be indexed. Returns a task object to track progress.

Operation
Write write
Schema command
kosmo integrations:schema meilisearch.meilisearch_add_documents --json
ParameterTypeRequiredDescription
index_uid string yes The index unique identifier (e.g., "movies").
documents array yes An array of document objects to add. Each document must contain the primary key field.
primary_key string no The primary key field name (e.g., "id"). Only needed if not already set on the index.

meilisearch.meilisearch_get_document

Retrieve a single document from a Meilisearch index by its primary key value.

Operation
Read read
Schema command
kosmo integrations:schema meilisearch.meilisearch_get_document --json
ParameterTypeRequiredDescription
index_uid string yes The index unique identifier (e.g., "movies").
doc_id string yes The document primary key value to retrieve.

meilisearch.meilisearch_get_health

Check the health status of the Meilisearch instance. Returns whether the server is available and operational.

Operation
Read read
Schema command
kosmo integrations:schema meilisearch.meilisearch_get_health --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.