KosmoKrator

productivity

Grist CLI for AI Agents

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

Grist CLI Setup

Grist can be configured headlessly with `kosmokrator integrations:configure grist`.

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 grist --set api_key="$GRIST_API_KEY" --set base_url="$GRIST_BASE_URL" --enable --read allow --write ask --json
kosmokrator integrations:doctor grist --json
kosmokrator integrations:status --json

Credentials

Authentication type: API key api_key. Configure credentials once, then reuse the same stored profile from scripts, coding CLIs, Lua, and MCP.

KeyEnv varTypeRequiredLabel
api_key GRIST_API_KEY Secret secret yes API Key
base_url GRIST_BASE_URL Text string yes Base URL

Command Patterns

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

Generic CLI call
kosmo integrations:call grist.grist_list_workspaces '{"org_id":1}' --json
Provider shortcut
kosmo integrations:grist grist_list_workspaces '{"org_id":1}' --json

Discovery

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

Discovery commands
kosmo integrations:docs grist --json
kosmo integrations:docs grist.grist_list_workspaces --json
kosmo integrations:schema grist.grist_list_workspaces --json
kosmo integrations:search "Grist" --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.

grist.grist_list_workspaces

List all workspaces in a Grist organization.

Read read
Parameters
org_id
Generic call
kosmo integrations:call grist.grist_list_workspaces '{"org_id":1}' --json
Shortcut
kosmo integrations:grist grist_list_workspaces '{"org_id":1}' --json

grist.grist_get_workspace

Get details for a single Grist workspace, including its documents.

Read read
Parameters
workspace_id
Generic call
kosmo integrations:call grist.grist_get_workspace '{"workspace_id":1}' --json
Shortcut
kosmo integrations:grist grist_get_workspace '{"workspace_id":1}' --json

grist.grist_list_docs

List all documents in a Grist organization.

Read read
Parameters
org_id
Generic call
kosmo integrations:call grist.grist_list_docs '{"org_id":1}' --json
Shortcut
kosmo integrations:grist grist_list_docs '{"org_id":1}' --json

grist.grist_get_doc

Get details for a single Grist document by ID.

Read read
Parameters
doc_id
Generic call
kosmo integrations:call grist.grist_get_doc '{"doc_id":"example_doc_id"}' --json
Shortcut
kosmo integrations:grist grist_get_doc '{"doc_id":"example_doc_id"}' --json

grist.grist_list_tables

List all tables in a Grist document.

Read read
Parameters
doc_id
Generic call
kosmo integrations:call grist.grist_list_tables '{"doc_id":"example_doc_id"}' --json
Shortcut
kosmo integrations:grist grist_list_tables '{"doc_id":"example_doc_id"}' --json

grist.grist_get_table

Get a single table from a Grist document.

Read read
Parameters
doc_id, table_id
Generic call
kosmo integrations:call grist.grist_get_table '{"doc_id":"example_doc_id","table_id":"example_table_id"}' --json
Shortcut
kosmo integrations:grist grist_get_table '{"doc_id":"example_doc_id","table_id":"example_table_id"}' --json

grist.grist_list_records

List records from a Grist table with optional filtering, sorting, and limiting.

Read read
Parameters
doc_id, table_id, limit, sort, filter
Generic call
kosmo integrations:call grist.grist_list_records '{"doc_id":"example_doc_id","table_id":"example_table_id","limit":1,"sort":"example_sort","filter":"example_filter"}' --json
Shortcut
kosmo integrations:grist grist_list_records '{"doc_id":"example_doc_id","table_id":"example_table_id","limit":1,"sort":"example_sort","filter":"example_filter"}' --json

grist.grist_get_record

Get full column data for a Grist table (raw cell values per column).

Read read
Parameters
doc_id, table_id
Generic call
kosmo integrations:call grist.grist_get_record '{"doc_id":"example_doc_id","table_id":"example_table_id"}' --json
Shortcut
kosmo integrations:grist grist_get_record '{"doc_id":"example_doc_id","table_id":"example_table_id"}' --json

grist.grist_create_records

Create one or more records in a Grist table.

Write write
Parameters
doc_id, table_id, records
Generic call
kosmo integrations:call grist.grist_create_records '{"doc_id":"example_doc_id","table_id":"example_table_id","records":"example_records"}' --json
Shortcut
kosmo integrations:grist grist_create_records '{"doc_id":"example_doc_id","table_id":"example_table_id","records":"example_records"}' --json

grist.grist_update_records

Update one or more existing records in a Grist table.

Write write
Parameters
doc_id, table_id, records
Generic call
kosmo integrations:call grist.grist_update_records '{"doc_id":"example_doc_id","table_id":"example_table_id","records":"example_records"}' --json
Shortcut
kosmo integrations:grist grist_update_records '{"doc_id":"example_doc_id","table_id":"example_table_id","records":"example_records"}' --json

grist.grist_delete_records

Delete records from a Grist table by row IDs.

Write write
Parameters
doc_id, table_id, record_ids
Generic call
kosmo integrations:call grist.grist_delete_records '{"doc_id":"example_doc_id","table_id":"example_table_id","record_ids":"example_record_ids"}' --json
Shortcut
kosmo integrations:grist grist_delete_records '{"doc_id":"example_doc_id","table_id":"example_table_id","record_ids":"example_record_ids"}' --json

grist.grist_create_column

Create a new column in a Grist table.

Write write
Parameters
doc_id, table_id, col_id, label, type, formula
Generic call
kosmo integrations:call grist.grist_create_column '{"doc_id":"example_doc_id","table_id":"example_table_id","col_id":"example_col_id","label":"example_label","type":"example_type","formula":"example_formula"}' --json
Shortcut
kosmo integrations:grist grist_create_column '{"doc_id":"example_doc_id","table_id":"example_table_id","col_id":"example_col_id","label":"example_label","type":"example_type","formula":"example_formula"}' --json

grist.grist_list_columns

List all columns in a Grist table.

Read read
Parameters
doc_id, table_id
Generic call
kosmo integrations:call grist.grist_list_columns '{"doc_id":"example_doc_id","table_id":"example_table_id"}' --json
Shortcut
kosmo integrations:grist grist_list_columns '{"doc_id":"example_doc_id","table_id":"example_table_id"}' --json

Function Schemas

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

grist.grist_list_workspaces 1 parameters
Schema command
kosmo integrations:schema grist.grist_list_workspaces --json
ParameterTypeRequiredDescription
org_id integer yes Grist organization ID.
grist.grist_get_workspace 1 parameters
Schema command
kosmo integrations:schema grist.grist_get_workspace --json
ParameterTypeRequiredDescription
workspace_id integer yes Grist workspace ID.
grist.grist_list_docs 1 parameters
Schema command
kosmo integrations:schema grist.grist_list_docs --json
ParameterTypeRequiredDescription
org_id integer yes Grist organization ID.
grist.grist_get_doc 1 parameters
Schema command
kosmo integrations:schema grist.grist_get_doc --json
ParameterTypeRequiredDescription
doc_id string yes Grist document ID.
grist.grist_list_tables 1 parameters
Schema command
kosmo integrations:schema grist.grist_list_tables --json
ParameterTypeRequiredDescription
doc_id string yes Grist document ID.
grist.grist_get_table 2 parameters
Schema command
kosmo integrations:schema grist.grist_get_table --json
ParameterTypeRequiredDescription
doc_id string yes Grist document ID.
table_id string yes Grist table ID.
grist.grist_list_records 5 parameters
Schema command
kosmo integrations:schema grist.grist_list_records --json
ParameterTypeRequiredDescription
doc_id string yes Grist document ID.
table_id string yes Grist table ID.
limit integer no Maximum number of records to return.
sort string no Sort expression, e.g. "Col1" (ascending) or "-Col1" (descending).
filter string no JSON object for column filtering, e.g. {"Col1": ["val1", "val2"]}.
grist.grist_get_record 2 parameters
Schema command
kosmo integrations:schema grist.grist_get_record --json
ParameterTypeRequiredDescription
doc_id string yes Grist document ID.
table_id string yes Grist table ID.
grist.grist_create_records 3 parameters
Schema command
kosmo integrations:schema grist.grist_create_records --json
ParameterTypeRequiredDescription
doc_id string yes Grist document ID.
table_id string yes Grist table ID.
records string yes JSON array of record objects, each with a "fields" key (e.g., [{"fields":{"Col1":"val","Col2":42}}]).
grist.grist_update_records 3 parameters
Schema command
kosmo integrations:schema grist.grist_update_records --json
ParameterTypeRequiredDescription
doc_id string yes Grist document ID.
table_id string yes Grist table ID.
records string yes JSON array of record updates, each with "id" and "fields" keys (e.g., [{"id":1,"fields":{"Col1":"new"}}]).
grist.grist_delete_records 3 parameters
Schema command
kosmo integrations:schema grist.grist_delete_records --json
ParameterTypeRequiredDescription
doc_id string yes Grist document ID.
table_id string yes Grist table ID.
record_ids string yes JSON array of row IDs to delete (e.g., [1, 2, 3]).
grist.grist_create_column 6 parameters
Schema command
kosmo integrations:schema grist.grist_create_column --json
ParameterTypeRequiredDescription
doc_id string yes Grist document ID.
table_id string yes Grist table ID.
col_id string yes Column identifier (used as the field key, e.g., "FirstName").
label string yes Human-readable column label.
type string yes Grist column type (e.g., "Text", "Int", "Numeric", "Bool", "Date", "Choice", "Ref", "Any").
formula string no Optional formula for a formula column (e.g., "$A + $B").
grist.grist_list_columns 2 parameters
Schema command
kosmo integrations:schema grist.grist_list_columns --json
ParameterTypeRequiredDescription
doc_id string yes Grist document ID.
table_id string yes Grist table ID.

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.