KosmoKrator

data

KeystoneJS CLI for AI Agents

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

7 functions 6 read 1 write Bearer token auth

KeystoneJS CLI Setup

KeystoneJS can be configured headlessly with `kosmokrator integrations:configure keystone`.

# 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 keystone --set access_token="$KEYSTONE_ACCESS_TOKEN" --set url="$KEYSTONE_URL" --enable --read allow --write ask --json
kosmokrator integrations:doctor keystone --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 KEYSTONE_ACCESS_TOKEN Secret secret yes Access Token
url KEYSTONE_URL URL url yes API Base URL

Call KeystoneJS Headlessly

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

kosmo integrations:call keystone.keystone_list_lists '{}' --json

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

kosmo integrations:keystone keystone_list_lists '{}' --json

Agent Discovery Commands

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

kosmo integrations:docs keystone --json
kosmo integrations:docs keystone.keystone_list_lists --json
kosmo integrations:schema keystone.keystone_list_lists --json
kosmo integrations:search "KeystoneJS" --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 KeystoneJS.

keystone.keystone_list_lists

Read read

List all available lists (collections) in the KeystoneJS instance. Returns list keys, labels, and metadata.

Parameters
none

Generic CLI call

kosmo integrations:call keystone.keystone_list_lists '{}' --json

Provider shortcut

kosmo integrations:keystone keystone_list_lists '{}' --json

keystone.keystone_get_list

Read read

Get metadata and field schema for a specific KeystoneJS list. Returns field definitions, access control, and display configuration.

Parameters
list_key

Generic CLI call

kosmo integrations:call keystone.keystone_get_list '{"list_key":"example_list_key"}' --json

Provider shortcut

kosmo integrations:keystone keystone_get_list '{"list_key":"example_list_key"}' --json

keystone.keystone_list_items

Read read

List items in a KeystoneJS list with optional filtering, sorting, and pagination. Returns an array of items from the specified list.

Parameters
list_key, take, skip, sort, where, search, fields

Generic CLI call

kosmo integrations:call keystone.keystone_list_items '{"list_key":"example_list_key","take":1,"skip":1,"sort":"example_sort","where":"example_where","search":"example_search","fields":"example_fields"}' --json

Provider shortcut

kosmo integrations:keystone keystone_list_items '{"list_key":"example_list_key","take":1,"skip":1,"sort":"example_sort","where":"example_where","search":"example_search","fields":"example_fields"}' --json

keystone.keystone_get_item

Read read

Retrieve a single item from a KeystoneJS list by its ID.

Parameters
list_key, id, fields

Generic CLI call

kosmo integrations:call keystone.keystone_get_item '{"list_key":"example_list_key","id":"example_id","fields":"example_fields"}' --json

Provider shortcut

kosmo integrations:keystone keystone_get_item '{"list_key":"example_list_key","id":"example_id","fields":"example_fields"}' --json

keystone.keystone_create_item

Write write

Create a new item in a KeystoneJS list with the provided field values.

Parameters
list_key, data

Generic CLI call

kosmo integrations:call keystone.keystone_create_item '{"list_key":"example_list_key","data":"example_data"}' --json

Provider shortcut

kosmo integrations:keystone keystone_create_item '{"list_key":"example_list_key","data":"example_data"}' --json

keystone.keystone_list_users

Read read

List users in the KeystoneJS instance with optional filtering, sorting, and pagination.

Parameters
take, skip, sort, where, search, fields

Generic CLI call

kosmo integrations:call keystone.keystone_list_users '{"take":1,"skip":1,"sort":"example_sort","where":"example_where","search":"example_search","fields":"example_fields"}' --json

Provider shortcut

kosmo integrations:keystone keystone_list_users '{"take":1,"skip":1,"sort":"example_sort","where":"example_where","search":"example_search","fields":"example_fields"}' --json

keystone.keystone_get_current_user

Read read

Get the profile of the currently authenticated KeystoneJS user. Useful for verifying the connection and understanding user permissions.

Parameters
fields

Generic CLI call

kosmo integrations:call keystone.keystone_get_current_user '{"fields":"example_fields"}' --json

Provider shortcut

kosmo integrations:keystone keystone_get_current_user '{"fields":"example_fields"}' --json

Function Schemas

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

keystone.keystone_list_lists

List all available lists (collections) in the KeystoneJS instance. Returns list keys, labels, and metadata.

Operation
Read read
Schema command
kosmo integrations:schema keystone.keystone_list_lists --json
ParameterTypeRequiredDescription
No parameters.

keystone.keystone_get_list

Get metadata and field schema for a specific KeystoneJS list. Returns field definitions, access control, and display configuration.

Operation
Read read
Schema command
kosmo integrations:schema keystone.keystone_get_list --json
ParameterTypeRequiredDescription
list_key string yes The list key (e.g. "posts", "users", "comments").

keystone.keystone_list_items

List items in a KeystoneJS list with optional filtering, sorting, and pagination. Returns an array of items from the specified list.

Operation
Read read
Schema command
kosmo integrations:schema keystone.keystone_list_items --json
ParameterTypeRequiredDescription
list_key string yes The list key to query (e.g. "posts", "users", "products").
take integer no Maximum number of items to return (default: 50).
skip integer no Number of items to skip for pagination.
sort string no Sort field(s). Prefix with "-" for descending (e.g. "-createdAt").
where object no Filter object for querying. E.g. {"status": {"equals": "published"}}.
search string no Search query to filter items across searchable fields.
fields string no Comma-separated list of fields to include in the response.

keystone.keystone_get_item

Retrieve a single item from a KeystoneJS list by its ID.

Operation
Read read
Schema command
kosmo integrations:schema keystone.keystone_get_item --json
ParameterTypeRequiredDescription
list_key string yes The list key (e.g. "posts", "users", "products").
id string yes The ID of the item to retrieve.
fields string no Comma-separated list of fields to include in the response.

keystone.keystone_create_item

Create a new item in a KeystoneJS list with the provided field values.

Operation
Write write
Schema command
kosmo integrations:schema keystone.keystone_create_item --json
ParameterTypeRequiredDescription
list_key string yes The list key (e.g. "posts", "users", "products").
data object yes Object containing the field values for the new item. Keys are field names, values are the field data.

keystone.keystone_list_users

List users in the KeystoneJS instance with optional filtering, sorting, and pagination.

Operation
Read read
Schema command
kosmo integrations:schema keystone.keystone_list_users --json
ParameterTypeRequiredDescription
take integer no Maximum number of users to return (default: 50).
skip integer no Number of users to skip for pagination.
sort string no Sort field(s). Prefix with "-" for descending.
where object no Filter object for querying. E.g. {"role": {"equals": "admin"}}.
search string no Search query to filter users by name or email.
fields string no Comma-separated list of fields to include in the response.

keystone.keystone_get_current_user

Get the profile of the currently authenticated KeystoneJS user. Useful for verifying the connection and understanding user permissions.

Operation
Read read
Schema command
kosmo integrations:schema keystone.keystone_get_current_user --json
ParameterTypeRequiredDescription
fields string no Comma-separated list of user fields to include (e.g. "id,name,email,role").

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.