Use the Fauna CLI from KosmoKrator to call Fauna tools headlessly, return JSON, inspect schemas, and automate workflows from coding agents, scripts, and CI.
Fauna can be configured headlessly with `kosmokrator integrations:configure fauna`.
# 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 fauna --set bearer_token="$FAUNA_BEARER_TOKEN" --enable --read allow --write ask --jsonkosmokrator integrations:doctor fauna --jsonkosmokrator integrations:status --json
Credentials
Authentication type: API tokenapi_token. Configure credentials once, then use the same stored profile from
scripts, coding CLIs, Lua code mode, and the MCP gateway.
Key
Env var
Type
Required
Label
bearer_token
FAUNA_BEARER_TOKEN
Secret secret
yes
Bearer Token
base_url
FAUNA_BASE_URL
Text string
no
Base URL
Call Fauna Headlessly
Use the generic call form when another coding CLI or script needs a stable universal interface.
Every function below can be called headlessly. The generic form is stable across all integrations;
the provider shortcut is shorter but specific to Fauna.
fauna.fauna_list_databases
Read read
List all databases in the current Fauna context. Returns database names
and their metadata including creation time and references.
Create a new Fauna database. Provide a database name and optional configuration.
Requires a server or admin key. Returns the created database metadata.
Execute a Fauna Query Language (FQL) expression. Provide the query as a JSON-encoded
FQL expression. Supports all FQL operations including document reads, writes,
indexes, and complex queries.
Create a new Fauna database. Provide a database name and optional configuration.
Requires a server or admin key. Returns the created database metadata.
Region group for the database (e.g., "us-east-1").
typecheck
boolean
no
Enable typechecking for the database.
fauna.fauna_query_fql
Execute a Fauna Query Language (FQL) expression. Provide the query as a JSON-encoded
FQL expression. Supports all FQL operations including document reads, writes,
indexes, and complex queries.
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.