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 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.
| Key | Env var | Type | Required | Label |
|---|---|---|---|---|
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.
kosmo integrations:call convex.convex_list_tables '{}' --json 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.
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 - Parameters
- none
kosmo integrations:call convex.convex_list_tables '{}' --json kosmo integrations:convex convex_list_tables '{}' --json convex.convex_get_table
Get metadata and schema for a specific Convex table.
read - Parameters
- table
kosmo integrations:call convex.convex_get_table '{"table":"example_table"}' --json 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 - Parameters
- table, filter, order, limit, cursor
kosmo integrations:call convex.convex_query_documents '{"table":"example_table","filter":"example_filter","order":"example_order","limit":1,"cursor":"example_cursor"}' --json 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 - Parameters
- table, fields
kosmo integrations:call convex.convex_create_document '{"table":"example_table","fields":"example_fields"}' --json 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 - Parameters
- table, document_id, fields
kosmo integrations:call convex.convex_update_document '{"table":"example_table","document_id":"example_document_id","fields":"example_fields"}' --json 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 - Parameters
- table, document_id
kosmo integrations:call convex.convex_delete_document '{"table":"example_table","document_id":"example_document_id"}' --json 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 - Parameters
- none
kosmo integrations:call convex.convex_get_current_user '{}' --json 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
kosmo integrations:schema convex.convex_list_tables --json | Parameter | Type | Required | Description |
|---|---|---|---|
| No parameters. | |||
convex.convex_get_table 1 parameters
kosmo integrations:schema convex.convex_get_table --json | Parameter | Type | Required | Description |
|---|---|---|---|
table | string | yes | Table name or ID. |
convex.convex_query_documents 5 parameters
kosmo integrations:schema convex.convex_query_documents --json | Parameter | Type | Required | Description |
|---|---|---|---|
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
kosmo integrations:schema convex.convex_create_document --json | Parameter | Type | Required | Description |
|---|---|---|---|
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
kosmo integrations:schema convex.convex_update_document --json | Parameter | Type | Required | Description |
|---|---|---|---|
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
kosmo integrations:schema convex.convex_delete_document --json | Parameter | Type | Required | Description |
|---|---|---|---|
table | string | yes | Table name. |
document_id | string | yes | Document ID. |
convex.convex_get_current_user 0 parameters
kosmo integrations:schema convex.convex_get_current_user --json | Parameter | Type | Required | Description |
|---|---|---|---|
| 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.