KosmoKrator

data

Fauna CLI for AI Agents

Use the Fauna CLI from KosmoKrator to call Fauna tools headlessly, return JSON, inspect schemas, and automate workflows from coding agents, scripts, and CI.

7 functions 5 read 1 write API token auth

Fauna CLI Setup

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 --json
kosmokrator integrations:doctor fauna --json
kosmokrator integrations:status --json

Credentials

Authentication type: API token api_token. Configure credentials once, then use the same stored profile from scripts, coding CLIs, Lua code mode, and the MCP gateway.

KeyEnv varTypeRequiredLabel
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.

kosmo integrations:call fauna.fauna_list_databases '{}' --json

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

kosmo integrations:fauna fauna_list_databases '{}' --json

Agent Discovery Commands

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

kosmo integrations:docs fauna --json
kosmo integrations:docs fauna.fauna_list_databases --json
kosmo integrations:schema fauna.fauna_list_databases --json
kosmo integrations:search "Fauna" --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 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.

Parameters
none

Generic CLI call

kosmo integrations:call fauna.fauna_list_databases '{}' --json

Provider shortcut

kosmo integrations:fauna fauna_list_databases '{}' --json

fauna.fauna_get_database

Read read

Get details of a specific Fauna database by name. Returns database metadata including name, reference, creation time, and configured options.

Parameters
name

Generic CLI call

kosmo integrations:call fauna.fauna_get_database '{"name":"example_name"}' --json

Provider shortcut

kosmo integrations:fauna fauna_get_database '{"name":"example_name"}' --json

fauna.fauna_create_database

Write write

Create a new Fauna database. Provide a database name and optional configuration. Requires a server or admin key. Returns the created database metadata.

Parameters
name, data_col, typecheck

Generic CLI call

kosmo integrations:call fauna.fauna_create_database '{"name":"example_name","data_col":"example_data_col","typecheck":true}' --json

Provider shortcut

kosmo integrations:fauna fauna_create_database '{"name":"example_name","data_col":"example_data_col","typecheck":true}' --json

fauna.fauna_query_fql

action action

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.

Parameters
query

Generic CLI call

kosmo integrations:call fauna.fauna_query_fql '{"query":"example_query"}' --json

Provider shortcut

kosmo integrations:fauna fauna_query_fql '{"query":"example_query"}' --json

fauna.fauna_list_collections

Read read

List all collections in the current Fauna database. Returns collection names and their metadata including references and creation time.

Parameters
none

Generic CLI call

kosmo integrations:call fauna.fauna_list_collections '{}' --json

Provider shortcut

kosmo integrations:fauna fauna_list_collections '{}' --json

fauna.fauna_get_collection

Read read

Get details of a specific Fauna collection by name. Returns collection metadata including name, reference, creation time, and configured options.

Parameters
name

Generic CLI call

kosmo integrations:call fauna.fauna_get_collection '{"name":"example_name"}' --json

Provider shortcut

kosmo integrations:fauna fauna_get_collection '{"name":"example_name"}' --json

fauna.fauna_get_current_user

Read read

Get the current authenticated Fauna key identity. Verifies the configured bearer token and returns the associated key identity information.

Parameters
none

Generic CLI call

kosmo integrations:call fauna.fauna_get_current_user '{}' --json

Provider shortcut

kosmo integrations:fauna fauna_get_current_user '{}' --json

Function Schemas

Use these parameter tables when building CLI payloads without calling integrations:schema first.

fauna.fauna_list_databases

List all databases in the current Fauna context. Returns database names and their metadata including creation time and references.

Operation
Read read
Schema command
kosmo integrations:schema fauna.fauna_list_databases --json
ParameterTypeRequiredDescription
No parameters.

fauna.fauna_get_database

Get details of a specific Fauna database by name. Returns database metadata including name, reference, creation time, and configured options.

Operation
Read read
Schema command
kosmo integrations:schema fauna.fauna_get_database --json
ParameterTypeRequiredDescription
name string yes Database name.

fauna.fauna_create_database

Create a new Fauna database. Provide a database name and optional configuration. Requires a server or admin key. Returns the created database metadata.

Operation
Write write
Schema command
kosmo integrations:schema fauna.fauna_create_database --json
ParameterTypeRequiredDescription
name string yes Database name.
data_col string no 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.

Operation
action action
Schema command
kosmo integrations:schema fauna.fauna_query_fql --json
ParameterTypeRequiredDescription
query string yes JSON-encoded FQL query expression.

fauna.fauna_list_collections

List all collections in the current Fauna database. Returns collection names and their metadata including references and creation time.

Operation
Read read
Schema command
kosmo integrations:schema fauna.fauna_list_collections --json
ParameterTypeRequiredDescription
No parameters.

fauna.fauna_get_collection

Get details of a specific Fauna collection by name. Returns collection metadata including name, reference, creation time, and configured options.

Operation
Read read
Schema command
kosmo integrations:schema fauna.fauna_get_collection --json
ParameterTypeRequiredDescription
name string yes Collection name.

fauna.fauna_get_current_user

Get the current authenticated Fauna key identity. Verifies the configured bearer token and returns the associated key identity information.

Operation
Read read
Schema command
kosmo integrations:schema fauna.fauna_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.