Overview
The Moda CLI gives you direct terminal access to your conversation analytics. Query dashboards, search conversations, investigate frustrations, and debug tool failures without leaving your shell.Prerequisites
- Node.js 18+
- A Moda API key (get one here)
Installation
Agent Skill
Install the Agent Skill so your AI assistant knows how to use the CLI:Commands
overview
Get a high-level dashboard of your conversation analytics.| Flag | Default | Description |
|---|---|---|
--days-back | 7 | Number of days to look back (1-90) |
clusters
Browse the topic cluster hierarchy.| Flag | Default | Description |
|---|---|---|
--parent-id | — | Parent node ID to drill down (omit for root) |
--time-range | all | all, 1h, 3d, 7d, 24h, 30d, 90d |
cluster-conversations
List conversations belonging to a specific cluster.| Argument / Flag | Default | Description |
|---|---|---|
<node_id> | required | Cluster node ID |
--limit | 10 | Max results (1-100) |
--offset | 0 | Pagination offset |
conversations
Search and filter conversations. The--world-state and --outcome flags let you
find conversations by what the agent has learned (world-state slots and durable user
profile) and by how they went.
| Flag | Default | Description |
|---|---|---|
--search | — | Full-text search in summaries |
--cluster-id | — | Filter by cluster node ID |
--user-id | — | Filter by user ID |
--time-range | all | all, 1h, 3d, 24h, 7d, 30d, 90d |
--environment | all | all, development, staging, production |
--world-state | — | Keyword(s) matched (case-insensitive substring) against world-state content — both segment slots and carried-in durable profile slots. Comma-separated terms are ANDed (all must appear). |
--outcome | any | any, positive, or negative. positive = a successful, progressing/recovered segment that is not frustrated; negative = the inverse. |
--include-world-state | off | Attach each result’s world-state summary (slots + segment summaries). |
--limit | 20 | Max results (1-100) |
--offset | 0 | Pagination offset |
World-state search is keyword-based, not
key=value: slot key naming isn’t
standardized across agents, so a keyword matches anywhere in a conversation’s
world-state content (slot keys, values, and durable profile).world-state
Get a single conversation’s world state — the structured slots, open threads, and the event log of how they were learned.| Argument / Flag | Default | Description |
|---|---|---|
<conversation_id> | required | Conversation ID |
--summary-only | off | Return segment summaries only (omit the event stream) |
--event-limit | 2000 | Max world-state events to return (1-5000) |
context
Get a window of messages from a conversation.| Argument / Flag | Default | Description |
|---|---|---|
<conversation_id> | required | Conversation ID |
--msg-index | middle | Message index to center on (0-indexed) |
--window | 2 | Messages before and after center (1-5) |
frustrations
Get user frustration detections with inline evidence.| Flag | Default | Description |
|---|---|---|
--days-back | 7 | Number of days to look back (1-90) |
--limit | 10 | Max results (1-20) |
--offset | 0 | Pagination offset |
tool-failures
Get tool failure overview.| Flag | Default | Description |
|---|---|---|
--days-back | 7 | Number of days to look back (1-90) |
tool-failure-detail
Get detailed failure info for a specific tool.| Argument / Flag | Default | Description |
|---|---|---|
<tool_name> | required | Name of the tool to inspect |
--subtype | — | Filter by error subtype |
--days-back | 7 | Number of days to look back (1-90) |
--limit | 5 | Max examples (1-20) |
--offset | 0 | Pagination offset |
prompts
Manage code-first prompt versions from your repo.| Command | Effect |
|---|---|
moda prompts init | Creates .moda/prompts.yml |
moda prompts status | Read-only local status |
moda prompts diff | Read-only local diff/status |
moda prompts sync | Uploads changed prompt versions and writes .moda/prompts.lock.json |
moda prompts sync --watch | Watches local prompt files and syncs when hashes change |
moda prompts promote | Moves a dev, staging, or prod label to a synced version |
Moda.prompt(...).render(...) or moda.prompt(...).render(...) so spans include prompt metadata. See Prompt Management.
Common Workflows
Daily Health Check
Debugging Frustrated Users
Investigating Tool Failures
Exploring User Intents
Output
All commands output JSON to stdout. Pipe tojq for filtering:
Environment Variables
| Variable | Required | Default | Description |
|---|---|---|---|
MODA_API_KEY | Yes | — | Your Moda API key (moda_sk_...) |
MODA_BASE_URL | No | https://moda.dev | Base URL for the Data API |
Troubleshooting
MODA_API_KEY environment variable not set
MODA_API_KEY environment variable not set
Export your API key before running commands:
No data returned
No data returned
- Verify your API key at moda.dev/settings
- Try
--days-back=30for a wider time range - Ensure conversations are being ingested (see Quickstart)
Connection errors
Connection errors
The CLI connects to
https://moda.dev by default. Override with MODA_BASE_URL if needed.Command not found
Command not found
Install globally:
npm install -g @moda-ai/cli. Or use npx: