KosmoKrator

other

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.

7 functions 7 read 0 write Bearer token auth

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

KeyEnv varTypeRequiredLabel
access_token PRISMIC_ACCESS_TOKEN Secret secret yes Access Token
repository PRISMIC_REPOSITORY Text text yes Repository Name

Call Prismic Headlessly

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

kosmo integrations:call prismic.prismic_list_documents '{
  "q": "example_q",
  "pageSize": 1,
  "page": 1,
  "orderings": "example_orderings",
  "lang": "example_lang",
  "ref": "example_ref"
}' --json

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

kosmo integrations:prismic prismic_list_documents '{
  "q": "example_q",
  "pageSize": 1,
  "page": 1,
  "orderings": "example_orderings",
  "lang": "example_lang",
  "ref": "example_ref"
}' --json

Agent Discovery Commands

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

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 Prismic.

prismic.prismic_list_documents

Read read

Search and list documents from the Prismic repository. Supports filtering with Prismic query predicates, pagination, ordering, and language selection.

Parameters
q, pageSize, page, orderings, lang, ref

Generic CLI call

kosmo integrations:call prismic.prismic_list_documents '{"q":"example_q","pageSize":1,"page":1,"orderings":"example_orderings","lang":"example_lang","ref":"example_ref"}' --json

Provider shortcut

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

Read read

Retrieve a single document from the Prismic repository by its unique document ID.

Parameters
id, ref, lang

Generic CLI call

kosmo integrations:call prismic.prismic_get_document '{"id":"example_id","ref":"example_ref","lang":"example_lang"}' --json

Provider shortcut

kosmo integrations:prismic prismic_get_document '{"id":"example_id","ref":"example_ref","lang":"example_lang"}' --json

prismic.prismic_list_types

Read read

List all custom types defined in the Prismic repository. Returns type IDs and names that can be used for document queries.

Parameters
limit, page

Generic CLI call

kosmo integrations:call prismic.prismic_list_types '{"limit":1,"page":1}' --json

Provider shortcut

kosmo integrations:prismic prismic_list_types '{"limit":1,"page":1}' --json

prismic.prismic_get_tags

Read read

List all tags defined in the Prismic repository. Tags can be used to filter documents in search queries.

Parameters
none

Generic CLI call

kosmo integrations:call prismic.prismic_get_tags '{}' --json

Provider shortcut

kosmo integrations:prismic prismic_get_tags '{}' --json

prismic.prismic_list_refs

Read read

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.

Parameters
none

Generic CLI call

kosmo integrations:call prismic.prismic_list_refs '{}' --json

Provider shortcut

kosmo integrations:prismic prismic_list_refs '{}' --json

prismic.prismic_list_languages

Read read

List all languages configured in the Prismic repository. Returns language codes and names that can be used for querying content in specific locales.

Parameters
none

Generic CLI call

kosmo integrations:call prismic.prismic_list_languages '{}' --json

Provider shortcut

kosmo integrations:prismic prismic_list_languages '{}' --json

prismic.prismic_get_current_user

Read read

Verify the Prismic API connection is working by performing a minimal document search. Returns connection status and repository information.

Parameters
none

Generic CLI call

kosmo integrations:call prismic.prismic_get_current_user '{}' --json

Provider shortcut

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

Search and list documents from the Prismic repository. Supports filtering with Prismic query predicates, pagination, ordering, and language selection.

Operation
Read read
Schema command
kosmo integrations:schema prismic.prismic_list_documents --json
ParameterTypeRequiredDescription
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

Retrieve a single document from the Prismic repository by its unique document ID.

Operation
Read read
Schema command
kosmo integrations:schema prismic.prismic_get_document --json
ParameterTypeRequiredDescription
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

List all custom types defined in the Prismic repository. Returns type IDs and names that can be used for document queries.

Operation
Read read
Schema command
kosmo integrations:schema prismic.prismic_list_types --json
ParameterTypeRequiredDescription
limit integer no Maximum number of types to return (default: 100).
page integer no Page number for pagination (default: 1).

prismic.prismic_get_tags

List all tags defined in the Prismic repository. Tags can be used to filter documents in search queries.

Operation
Read read
Schema command
kosmo integrations:schema prismic.prismic_get_tags --json
ParameterTypeRequiredDescription
No parameters.

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.

Operation
Read read
Schema command
kosmo integrations:schema prismic.prismic_list_refs --json
ParameterTypeRequiredDescription
No parameters.

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.

Operation
Read read
Schema command
kosmo integrations:schema prismic.prismic_list_languages --json
ParameterTypeRequiredDescription
No parameters.

prismic.prismic_get_current_user

Verify the Prismic API connection is working by performing a minimal document search. Returns connection status and repository information.

Operation
Read read
Schema command
kosmo integrations:schema prismic.prismic_get_current_user --json
ParameterTypeRequiredDescription
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.