KosmoKrator

data

Convex CLI for AI Agents

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

7 functions 4 read 3 write Bearer token auth

Convex CLI Setup

Convex can be configured headlessly with `kosmokrator integrations:configure convex`.

# 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 convex --set access_token="$CONVEX_ACCESS_TOKEN" --enable --read allow --write ask --json
kosmokrator integrations:doctor convex --json
kosmokrator integrations:status --json

Credentials

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

KeyEnv varTypeRequiredLabel
access_token CONVEX_ACCESS_TOKEN Secret secret yes Access Token

Call Convex Headlessly

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

kosmo integrations:call convex.convex_list_tables '{}' --json

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

kosmo integrations:convex convex_list_tables '{}' --json

Agent Discovery Commands

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

kosmo integrations:docs convex --json
kosmo integrations:docs convex.convex_list_tables --json
kosmo integrations:schema convex.convex_list_tables --json
kosmo integrations:search "Convex" --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 Convex.

convex.convex_list_tables

Read read

List all tables in the Convex deployment.

Parameters
none

Generic CLI call

kosmo integrations:call convex.convex_list_tables '{}' --json

Provider shortcut

kosmo integrations:convex convex_list_tables '{}' --json

convex.convex_get_table

Read read

Get metadata and schema for a specific Convex table.

Parameters
table

Generic CLI call

kosmo integrations:call convex.convex_get_table '{"table":"example_table"}' --json

Provider shortcut

kosmo integrations:convex convex_get_table '{"table":"example_table"}' --json

convex.convex_query_documents

Read read

Query documents from a Convex table with optional filtering and pagination.

Parameters
table, filter, order, limit, cursor

Generic CLI call

kosmo integrations:call convex.convex_query_documents '{"table":"example_table","filter":"example_filter","order":"example_order","limit":1,"cursor":"example_cursor"}' --json

Provider shortcut

kosmo integrations:convex convex_query_documents '{"table":"example_table","filter":"example_filter","order":"example_order","limit":1,"cursor":"example_cursor"}' --json

convex.convex_create_document

Write write

Create a new document in a Convex table.

Parameters
table, fields

Generic CLI call

kosmo integrations:call convex.convex_create_document '{"table":"example_table","fields":"example_fields"}' --json

Provider shortcut

kosmo integrations:convex convex_create_document '{"table":"example_table","fields":"example_fields"}' --json

convex.convex_update_document

Write write

Update an existing document in a Convex table.

Parameters
table, document_id, fields

Generic CLI call

kosmo integrations:call convex.convex_update_document '{"table":"example_table","document_id":"example_document_id","fields":"example_fields"}' --json

Provider shortcut

kosmo integrations:convex convex_update_document '{"table":"example_table","document_id":"example_document_id","fields":"example_fields"}' --json

convex.convex_delete_document

Write write

Delete a document from a Convex table.

Parameters
table, document_id

Generic CLI call

kosmo integrations:call convex.convex_delete_document '{"table":"example_table","document_id":"example_document_id"}' --json

Provider shortcut

kosmo integrations:convex convex_delete_document '{"table":"example_table","document_id":"example_document_id"}' --json

convex.convex_get_current_user

Read read

Get the authenticated Convex user's profile information. Returns account details like name and email. Use this to verify API connectivity.

Parameters
none

Generic CLI call

kosmo integrations:call convex.convex_get_current_user '{}' --json

Provider shortcut

kosmo integrations:convex convex_get_current_user '{}' --json

Function Schemas

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

convex.convex_list_tables

List all tables in the Convex deployment.

Operation
Read read
Schema command
kosmo integrations:schema convex.convex_list_tables --json
ParameterTypeRequiredDescription
No parameters.

convex.convex_get_table

Get metadata and schema for a specific Convex table.

Operation
Read read
Schema command
kosmo integrations:schema convex.convex_get_table --json
ParameterTypeRequiredDescription
table string yes Table name or ID.

convex.convex_query_documents

Query documents from a Convex table with optional filtering and pagination.

Operation
Read read
Schema command
kosmo integrations:schema convex.convex_query_documents --json
ParameterTypeRequiredDescription
table string yes Table name.
filter string no JSON object of field name → value pairs to filter documents by.
order string no Field name to order results by. Prefix with "-" for descending (e.g., "-createdAt").
limit integer no Maximum number of documents to return.
cursor string no Pagination cursor from a previous response.

convex.convex_create_document

Create a new document in a Convex table.

Operation
Write write
Schema command
kosmo integrations:schema convex.convex_create_document --json
ParameterTypeRequiredDescription
table string yes Table name.
fields string yes JSON object of field name → value pairs (e.g., {"name":"John","age":30}).

convex.convex_update_document

Update an existing document in a Convex table.

Operation
Write write
Schema command
kosmo integrations:schema convex.convex_update_document --json
ParameterTypeRequiredDescription
table string yes Table name.
document_id string yes Document ID.
fields string yes JSON object of field name → value pairs to update.

convex.convex_delete_document

Delete a document from a Convex table.

Operation
Write write
Schema command
kosmo integrations:schema convex.convex_delete_document --json
ParameterTypeRequiredDescription
table string yes Table name.
document_id string yes Document ID.

convex.convex_get_current_user

Get the authenticated Convex user's profile information. Returns account details like name and email. Use this to verify API connectivity.

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