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.

Convex CLI Setup

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

Install, configure, and verify
# 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 reuse the same stored profile from scripts, coding CLIs, Lua, and MCP.

KeyEnv varTypeRequiredLabel
access_token CONVEX_ACCESS_TOKEN Secret secret yes Access Token

Command Patterns

The generic command is stable across every integration. The provider shortcut is shorter for humans.

Generic CLI call
kosmo integrations:call convex.convex_list_tables '{}' --json
Provider shortcut
kosmo integrations:convex convex_list_tables '{}' --json

Discovery

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

Discovery commands
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

Automation Contexts

The same configured command surface works in these environments. The command does not change unless the host wrapper, credentials, or permissions change.

CLI Functions

Every function below can be called headlessly. Commands are highlighted, copyable, and scroll horizontally when payloads are long.

convex.convex_list_tables

List all tables in the Convex deployment.

Read read
Parameters
none
Generic call
kosmo integrations:call convex.convex_list_tables '{}' --json
Shortcut
kosmo integrations:convex convex_list_tables '{}' --json

convex.convex_get_table

Get metadata and schema for a specific Convex table.

Read read
Parameters
table
Generic call
kosmo integrations:call convex.convex_get_table '{"table":"example_table"}' --json
Shortcut
kosmo integrations:convex convex_get_table '{"table":"example_table"}' --json

convex.convex_query_documents

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

Read read
Parameters
table, filter, order, limit, cursor
Generic call
kosmo integrations:call convex.convex_query_documents '{"table":"example_table","filter":"example_filter","order":"example_order","limit":1,"cursor":"example_cursor"}' --json
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

Create a new document in a Convex table.

Write write
Parameters
table, fields
Generic call
kosmo integrations:call convex.convex_create_document '{"table":"example_table","fields":"example_fields"}' --json
Shortcut
kosmo integrations:convex convex_create_document '{"table":"example_table","fields":"example_fields"}' --json

convex.convex_update_document

Update an existing document in a Convex table.

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

convex.convex_delete_document

Delete a document from a Convex table.

Write write
Parameters
table, document_id
Generic call
kosmo integrations:call convex.convex_delete_document '{"table":"example_table","document_id":"example_document_id"}' --json
Shortcut
kosmo integrations:convex convex_delete_document '{"table":"example_table","document_id":"example_document_id"}' --json

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.

Read read
Parameters
none
Generic call
kosmo integrations:call convex.convex_get_current_user '{}' --json
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 0 parameters
Schema command
kosmo integrations:schema convex.convex_list_tables --json
ParameterTypeRequiredDescription
No parameters.
convex.convex_get_table 1 parameters
Schema command
kosmo integrations:schema convex.convex_get_table --json
ParameterTypeRequiredDescription
table string yes Table name or ID.
convex.convex_query_documents 5 parameters
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 2 parameters
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 3 parameters
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 2 parameters
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 0 parameters
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.