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 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.
| Key | Env var | Type | Required | Label |
|---|---|---|---|---|
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.
kosmo integrations:call keystone.keystone_list_lists '{}' --json 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.
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 - Parameters
- none
kosmo integrations:call keystone.keystone_list_lists '{}' --json 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 - Parameters
- list_key
kosmo integrations:call keystone.keystone_get_list '{"list_key":"example_list_key"}' --json 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 - Parameters
- list_key, take, skip, sort, where, search, fields
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 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 - Parameters
- list_key, id, fields
kosmo integrations:call keystone.keystone_get_item '{"list_key":"example_list_key","id":"example_id","fields":"example_fields"}' --json 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 - Parameters
- list_key, data
kosmo integrations:call keystone.keystone_create_item '{"list_key":"example_list_key","data":"example_data"}' --json 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 - Parameters
- take, skip, sort, where, search, fields
kosmo integrations:call keystone.keystone_list_users '{"take":1,"skip":1,"sort":"example_sort","where":"example_where","search":"example_search","fields":"example_fields"}' --json 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 - Parameters
- fields
kosmo integrations:call keystone.keystone_get_current_user '{"fields":"example_fields"}' --json 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
kosmo integrations:schema keystone.keystone_list_lists --json | Parameter | Type | Required | Description |
|---|---|---|---|
| No parameters. | |||
keystone.keystone_get_list 1 parameters
kosmo integrations:schema keystone.keystone_get_list --json | Parameter | Type | Required | Description |
|---|---|---|---|
list_key | string | yes | The list key (e.g. "posts", "users", "comments"). |
keystone.keystone_list_items 7 parameters
kosmo integrations:schema keystone.keystone_list_items --json | Parameter | Type | Required | Description |
|---|---|---|---|
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
kosmo integrations:schema keystone.keystone_get_item --json | Parameter | Type | Required | Description |
|---|---|---|---|
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
kosmo integrations:schema keystone.keystone_create_item --json | Parameter | Type | Required | Description |
|---|---|---|---|
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
kosmo integrations:schema keystone.keystone_list_users --json | Parameter | Type | Required | Description |
|---|---|---|---|
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
kosmo integrations:schema keystone.keystone_get_current_user --json | Parameter | Type | Required | Description |
|---|---|---|---|
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.