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.

KeystoneJS CLI Setup

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

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

KeyEnv varTypeRequiredLabel
access_token KEYSTONE_ACCESS_TOKEN Secret secret yes Access Token
url KEYSTONE_URL URL url yes API 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 keystone.keystone_list_lists '{}' --json
Provider shortcut
kosmo integrations:keystone keystone_list_lists '{}' --json

Discovery

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

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

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.

keystone.keystone_list_lists

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

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

keystone.keystone_get_list

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

Read read
Parameters
list_key
Generic call
kosmo integrations:call keystone.keystone_get_list '{"list_key":"example_list_key"}' --json
Shortcut
kosmo integrations:keystone keystone_get_list '{"list_key":"example_list_key"}' --json

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.

Read read
Parameters
list_key, take, skip, sort, where, search, fields
Generic 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
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

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

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

keystone.keystone_create_item

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

Write write
Parameters
list_key, data
Generic call
kosmo integrations:call keystone.keystone_create_item '{"list_key":"example_list_key","data":"example_data"}' --json
Shortcut
kosmo integrations:keystone keystone_create_item '{"list_key":"example_list_key","data":"example_data"}' --json

keystone.keystone_list_users

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

Read read
Parameters
take, skip, sort, where, search, fields
Generic 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
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

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

Read read
Parameters
fields
Generic call
kosmo integrations:call keystone.keystone_get_current_user '{"fields":"example_fields"}' --json
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 0 parameters
Schema command
kosmo integrations:schema keystone.keystone_list_lists --json
ParameterTypeRequiredDescription
No parameters.
keystone.keystone_get_list 1 parameters
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 7 parameters
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 3 parameters
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 2 parameters
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 6 parameters
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 1 parameters
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.