data
Prismic CLI for AI Agents
Use the Prismic CLI from KosmoKrator to call Prismic tools headlessly, return JSON, inspect schemas, and automate workflows from coding agents, scripts, and CI.Prismic CLI Setup
Prismic can be configured headlessly with `kosmokrator integrations:configure prismic`.
# 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 prismic --set access_token="$PRISMIC_ACCESS_TOKEN" --set repository="$PRISMIC_REPOSITORY" --enable --read allow --write ask --json
kosmokrator integrations:doctor prismic --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 | PRISMIC_ACCESS_TOKEN | Secret secret | yes | Access Token |
repository | PRISMIC_REPOSITORY | Text text | yes | Repository Name |
Command Patterns
The generic command is stable across every integration. The provider shortcut is shorter for humans.
kosmo integrations:call prismic.prismic_list_documents '{"q":"example_q","pageSize":1,"page":1,"orderings":"example_orderings","lang":"example_lang","ref":"example_ref"}' --json kosmo integrations:prismic prismic_list_documents '{"q":"example_q","pageSize":1,"page":1,"orderings":"example_orderings","lang":"example_lang","ref":"example_ref"}' --json Discovery
These commands return structured output for coding agents that need to inspect capabilities before choosing a function.
kosmo integrations:docs prismic --json
kosmo integrations:docs prismic.prismic_list_documents --json
kosmo integrations:schema prismic.prismic_list_documents --json
kosmo integrations:search "Prismic" --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.
prismic.prismic_list_documents
Search and list documents from the Prismic repository. Supports filtering with Prismic query predicates, pagination, ordering, and language selection.
read - Parameters
- q, pageSize, page, orderings, lang, ref
kosmo integrations:call prismic.prismic_list_documents '{"q":"example_q","pageSize":1,"page":1,"orderings":"example_orderings","lang":"example_lang","ref":"example_ref"}' --json kosmo integrations:prismic prismic_list_documents '{"q":"example_q","pageSize":1,"page":1,"orderings":"example_orderings","lang":"example_lang","ref":"example_ref"}' --json prismic.prismic_get_document
Retrieve a single document from the Prismic repository by its unique document ID.
read - Parameters
- id, ref, lang
kosmo integrations:call prismic.prismic_get_document '{"id":"example_id","ref":"example_ref","lang":"example_lang"}' --json kosmo integrations:prismic prismic_get_document '{"id":"example_id","ref":"example_ref","lang":"example_lang"}' --json prismic.prismic_list_types
List all custom types defined in the Prismic repository. Returns type IDs and names that can be used for document queries.
read - Parameters
- limit, page
kosmo integrations:call prismic.prismic_list_types '{"limit":1,"page":1}' --json kosmo integrations:prismic prismic_list_types '{"limit":1,"page":1}' --json prismic.prismic_get_tags
List all tags defined in the Prismic repository. Tags can be used to filter documents in search queries.
read - Parameters
- none
kosmo integrations:call prismic.prismic_get_tags '{}' --json kosmo integrations:prismic prismic_get_tags '{}' --json prismic.prismic_list_refs
List all refs (releases and drafts) for the Prismic repository. The master ref points to the published content; other refs point to drafts or releases in progress.
read - Parameters
- none
kosmo integrations:call prismic.prismic_list_refs '{}' --json kosmo integrations:prismic prismic_list_refs '{}' --json prismic.prismic_list_languages
List all languages configured in the Prismic repository. Returns language codes and names that can be used for querying content in specific locales.
read - Parameters
- none
kosmo integrations:call prismic.prismic_list_languages '{}' --json kosmo integrations:prismic prismic_list_languages '{}' --json prismic.prismic_get_current_user
Verify the Prismic API connection is working by performing a minimal document search. Returns connection status and repository information.
read - Parameters
- none
kosmo integrations:call prismic.prismic_get_current_user '{}' --json kosmo integrations:prismic prismic_get_current_user '{}' --json Function Schemas
Use these parameter tables when building CLI payloads without calling integrations:schema first.
prismic.prismic_list_documents 6 parameters
kosmo integrations:schema prismic.prismic_list_documents --json | Parameter | Type | Required | Description |
|---|---|---|---|
q | string | no | Prismic query predicate(s), e.g. '[[:d = at(document.type, "blog_post")]]'. Multiple predicates can be combined. |
pageSize | integer | no | Number of documents per page (default: 20, max: 100). |
page | integer | no | Page number for pagination (default: 1). |
orderings | string | no | Ordering rules, e.g. "[my.blog_post.date desc]". |
lang | string | no | Language code to filter results (e.g., "en-us", "fr-fr"). Use "*" for all languages. |
ref | string | no | The ref (release/draft) ID to query. Defaults to the master ref. |
prismic.prismic_get_document 3 parameters
kosmo integrations:schema prismic.prismic_get_document --json | Parameter | Type | Required | Description |
|---|---|---|---|
id | string | yes | The unique document ID (e.g., "YjRHVhAAACEAnFqZ"). |
ref | string | no | The ref (release/draft) ID to query. Defaults to the master ref. |
lang | string | no | Language code to retrieve a specific translation (e.g., "en-us", "fr-fr"). |
prismic.prismic_list_types 2 parameters
kosmo integrations:schema prismic.prismic_list_types --json | Parameter | Type | Required | Description |
|---|---|---|---|
limit | integer | no | Maximum number of types to return (default: 100). |
page | integer | no | Page number for pagination (default: 1). |
prismic.prismic_get_tags 0 parameters
kosmo integrations:schema prismic.prismic_get_tags --json | Parameter | Type | Required | Description |
|---|---|---|---|
| No parameters. | |||
prismic.prismic_list_refs 0 parameters
kosmo integrations:schema prismic.prismic_list_refs --json | Parameter | Type | Required | Description |
|---|---|---|---|
| No parameters. | |||
prismic.prismic_list_languages 0 parameters
kosmo integrations:schema prismic.prismic_list_languages --json | Parameter | Type | Required | Description |
|---|---|---|---|
| No parameters. | |||
prismic.prismic_get_current_user 0 parameters
kosmo integrations:schema prismic.prismic_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.