data
Fauna CLI for Shell Scripts
Use the Fauna CLI for shell scripts with headless JSON commands, schema discovery, credentials, and permission controls.
7 functions 5 read 1 write API token auth
Fauna CLI for Shell Scripts
Call integration functions from shell scripts with stable JSON input and output.
Use shell scripts for small local automations that need one or more integration calls. The Fauna CLI uses the same integration registry as the TUI, Lua runtime, and MCP gateway, but returns predictable command output for automation.
Command Shape
# Fauna CLI for Shell Scripts
kosmokrator integrations:configure fauna --set bearer_token="$FAUNA_BEARER_TOKEN" --enable --read allow --write ask --json
kosmo integrations:call fauna.fauna_list_databases '{}' --json Discovery Before Execution
Agents and scripts can inspect Fauna docs and schemas 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 Useful Fauna CLI Functions
| Function | Type | Parameters | Description |
|---|---|---|---|
fauna.fauna_list_databases | Read | none | List all databases in the current Fauna context. Returns database names and their metadata including creation time and references. |
fauna.fauna_get_database | Read | name | Get details of a specific Fauna database by name. Returns database metadata including name, reference, creation time, and configured options. |
fauna.fauna_create_database | Write | name, data_col, typecheck | Create a new Fauna database. Provide a database name and optional configuration. Requires a server or admin key. Returns the created database metadata. |
fauna.fauna_query_fql | action | query | 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. |
fauna.fauna_list_collections | Read | none | List all collections in the current Fauna database. Returns collection names and their metadata including references and creation time. |
fauna.fauna_get_collection | Read | name | Get details of a specific Fauna collection by name. Returns collection metadata including name, reference, creation time, and configured options. |
fauna.fauna_get_current_user | Read | none | Get the current authenticated Fauna key identity. Verifies the configured bearer token and returns the associated key identity information. |
Automation Notes
- Use
--jsonfor machine-readable output. - Keep credentials out of argv by using environment variables or stored KosmoKrator configuration.
- Configure read/write policy before unattended runs; use
--forceonly for trusted automation. - Use the MCP gateway instead when the agent needs dynamic tool discovery inside a conversation.