KosmoKrator

data

Typesense CLI for AI Agents

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

7 functions 5 read 2 write API key auth

Typesense CLI Setup

Typesense can be configured headlessly with `kosmokrator integrations:configure typesense`.

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

Call Typesense Headlessly

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

kosmo integrations:call typesense.typesense_list_collections '{}' --json

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

kosmo integrations:typesense typesense_list_collections '{}' --json

Agent Discovery Commands

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

kosmo integrations:docs typesense --json
kosmo integrations:docs typesense.typesense_list_collections --json
kosmo integrations:schema typesense.typesense_list_collections --json
kosmo integrations:search "Typesense" --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 Typesense.

typesense.typesense_list_collections

Read read

List all collections in the Typesense search instance. Returns collection names, document counts, and schema details.

Parameters
none

Generic CLI call

kosmo integrations:call typesense.typesense_list_collections '{}' --json

Provider shortcut

kosmo integrations:typesense typesense_list_collections '{}' --json

typesense.typesense_get_collection

Read read

Get details of a specific Typesense collection by name, including its schema, field definitions, and document count.

Parameters
name

Generic CLI call

kosmo integrations:call typesense.typesense_get_collection '{"name":"example_name"}' --json

Provider shortcut

kosmo integrations:typesense typesense_get_collection '{"name":"example_name"}' --json

typesense.typesense_create_collection

Write write

Create a new collection in Typesense with a specified schema including field definitions and optional default sorting field.

Parameters
name, fields, default_sorting_field

Generic CLI call

kosmo integrations:call typesense.typesense_create_collection '{"name":"example_name","fields":"example_fields","default_sorting_field":"example_default_sorting_field"}' --json

Provider shortcut

kosmo integrations:typesense typesense_create_collection '{"name":"example_name","fields":"example_fields","default_sorting_field":"example_default_sorting_field"}' --json

typesense.typesense_search_documents

Read read

Search for documents in a Typesense collection. Supports full-text search, filtering, sorting, and pagination.

Parameters
collection, q, query_by, filter_by, sort_by, per_page, page

Generic CLI call

kosmo integrations:call typesense.typesense_search_documents '{"collection":"example_collection","q":"example_q","query_by":"example_query_by","filter_by":"example_filter_by","sort_by":"example_sort_by","per_page":1,"page":1}' --json

Provider shortcut

kosmo integrations:typesense typesense_search_documents '{"collection":"example_collection","q":"example_q","query_by":"example_query_by","filter_by":"example_filter_by","sort_by":"example_sort_by","per_page":1,"page":1}' --json

typesense.typesense_index_document

Write write

Index (create or update) a document in a Typesense collection. The document must conform to the collection's schema.

Parameters
collection, document

Generic CLI call

kosmo integrations:call typesense.typesense_index_document '{"collection":"example_collection","document":"example_document"}' --json

Provider shortcut

kosmo integrations:typesense typesense_index_document '{"collection":"example_collection","document":"example_document"}' --json

typesense.typesense_get_document

Read read

Retrieve a single document from a Typesense collection by its ID.

Parameters
collection, id

Generic CLI call

kosmo integrations:call typesense.typesense_get_document '{"collection":"example_collection","id":"example_id"}' --json

Provider shortcut

kosmo integrations:typesense typesense_get_document '{"collection":"example_collection","id":"example_id"}' --json

typesense.typesense_get_health

Read read

Check the health status of the Typesense search instance. Returns whether the service is reachable and healthy.

Parameters
none

Generic CLI call

kosmo integrations:call typesense.typesense_get_health '{}' --json

Provider shortcut

kosmo integrations:typesense typesense_get_health '{}' --json

Function Schemas

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

typesense.typesense_list_collections

List all collections in the Typesense search instance. Returns collection names, document counts, and schema details.

Operation
Read read
Schema command
kosmo integrations:schema typesense.typesense_list_collections --json
ParameterTypeRequiredDescription
No parameters.

typesense.typesense_get_collection

Get details of a specific Typesense collection by name, including its schema, field definitions, and document count.

Operation
Read read
Schema command
kosmo integrations:schema typesense.typesense_get_collection --json
ParameterTypeRequiredDescription
name string yes The name of the collection to retrieve.

typesense.typesense_create_collection

Create a new collection in Typesense with a specified schema including field definitions and optional default sorting field.

Operation
Write write
Schema command
kosmo integrations:schema typesense.typesense_create_collection --json
ParameterTypeRequiredDescription
name string yes The name for the new collection.
fields array yes Array of field definitions. Each field should have "name", "type" (e.g., "string", "int32", "float", "bool"), and optionally "facet", "optional", "index".
default_sorting_field string no The name of an int32 or float field to use for default sorting.

typesense.typesense_search_documents

Search for documents in a Typesense collection. Supports full-text search, filtering, sorting, and pagination.

Operation
Read read
Schema command
kosmo integrations:schema typesense.typesense_search_documents --json
ParameterTypeRequiredDescription
collection string yes The name of the collection to search in.
q string yes The search query string. Use "*" to match all documents.
query_by string yes Comma-separated list of fields to search in (e.g., "title,description").
filter_by string no Filter conditions (e.g., "category:electronics AND price:<100").
sort_by string no Sort criteria (e.g., "price:asc", "created_at:desc").
per_page integer no Number of results per page (default: 10, max: 250).
page integer no Page number for pagination (default: 1).

typesense.typesense_index_document

Index (create or update) a document in a Typesense collection. The document must conform to the collection's schema.

Operation
Write write
Schema command
kosmo integrations:schema typesense.typesense_index_document --json
ParameterTypeRequiredDescription
collection string yes The name of the collection to index the document into.
document object yes The document data to index. Must include an "id" field matching the collection schema.

typesense.typesense_get_document

Retrieve a single document from a Typesense collection by its ID.

Operation
Read read
Schema command
kosmo integrations:schema typesense.typesense_get_document --json
ParameterTypeRequiredDescription
collection string yes The name of the collection containing the document.
id string yes The ID of the document to retrieve.

typesense.typesense_get_health

Check the health status of the Typesense search instance. Returns whether the service is reachable and healthy.

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