analytics
Plausible Analytics CLI for Headless Automation
Use the Plausible Analytics CLI for headless automation with headless JSON commands, schema discovery, credentials, and permission controls.
8 functions 4 read 4 write API key auth
Plausible Analytics CLI for Headless Automation
Use KosmoKrator as a non-interactive integration runtime for local automations and wrappers.
Use headless automation when another tool needs a stable local command surface. The Plausible Analytics CLI uses the same integration registry as the TUI, Lua runtime, and MCP gateway, but returns predictable command output for automation.
Command Shape
# Plausible Analytics CLI for Headless Automation
kosmokrator integrations:configure plausible --set api_key="$PLAUSIBLE_API_KEY" --enable --read allow --write ask --json
kosmo integrations:call plausible.plausible_query_stats '{"site_id":"example_site_id","metrics":"example_metrics","date_range":"example_date_range","dimensions":"example_dimensions","filters":"example_filters","date_from":"example_date_from","date_to":"example_date_to","order_by":"example_order_by"}' --json Discovery Before Execution
Agents and scripts can inspect Plausible Analytics docs and schemas before choosing a function.
kosmo integrations:docs plausible --json
kosmo integrations:docs plausible.plausible_query_stats --json
kosmo integrations:schema plausible.plausible_query_stats --json
kosmo integrations:search "Plausible Analytics" --json
kosmo integrations:list --json Useful Plausible Analytics CLI Functions
| Function | Type | Parameters | Description |
|---|---|---|---|
plausible.plausible_query_stats | Read | site_id, metrics, date_range, dimensions, filters, date_from, date_to, order_by, limit | Query website analytics from Plausible. Supports aggregate stats, timeseries, and breakdowns by dimension. Use dimensions to group results (e.g., by country, source, page). Omit dimensions for simple aggregate totals. |
plausible.plausible_realtime_visitors | Read | site_id | Get the current number of realtime visitors on a website (visitors in the last 5 minutes). |
plausible.plausible_list_sites | Read | limit, after | List websites tracked in Plausible Analytics. Returns site domains you can query for analytics data. |
plausible.plausible_create_site | Write | domain, timezone | Register a new website for tracking in Plausible Analytics. |
plausible.plausible_delete_site | Write | site_id | Remove a website from Plausible Analytics tracking. This deletes all associated data. |
plausible.plausible_list_goals | Read | site_id | List all goals (conversion tracking) configured for a website in Plausible. |
plausible.plausible_create_goal | Write | site_id, event_name, page_path | Create a conversion goal for a website in Plausible. Goals can track pageviews to specific pages or custom events. |
plausible.plausible_delete_goal | Write | site_id, goal_id | Delete a conversion goal from a website in Plausible. |
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.