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.
Returns total conversations, trend percentage, frustration rate, tool failure summary, top clusters, and recent activity.
clusters
Browse the topic cluster hierarchy.cluster-conversations
List conversations belonging to a specific cluster.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.
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).PRM scoring is segment-grain:
--outcome judges conversations that have
per-segment scores on a weighted blend of their segment closing scores
(unit-count weighted, recency-decayed, lifecycle-status weighted).
Conversations without segment scores — history from before scoring moved to
segment grain — are judged on the legacy whole-conversation closing score.
The step-scores endpoint (GET /v1/data/conversations/:id/step-scores)
returns segments[] (per-terminal-segment score curves, newest scoring pass
per segment) and rollup (the weighted blend, null until the segment lane
has scored the conversation); its top-level steps[] curve comes from the
retired whole-conversation lane and is populated only for those pre-cutover
conversations.search
Search message anchors with keyword, semantic, or hybrid retrieval. Results always includeconversation_id, message_index, snippet, and score.
Unit-backed tenants may also return unit_id, content_block_index,
block_type, tool_name, and chunk_index.
world-state
Get a single conversation’s world state — the structured slots, open threads, and the event log of how they were learned.context
Get a window of messages from a conversation.
Returns messages centered around the specified index: window messages before + center message + window messages after.
frustrations
Get user frustration detections with inline evidence.
Each result includes frustration score, trajectory, primary cause, user quotes, signal breakdown, and inline conversation context.
tool-failures
Get tool failure overview.tool-failure-detail
Get detailed failure info for a specific tool.feedback
Flag wrong or missing data (a cluster label that doesn’t fit, a frustration that doesn’t match its transcript, an empty result that shouldn’t be) or a CLI quirk. Feedback is tenant-scoped and goes straight to the Moda team.
The CLI nudges callers toward this command: successful agent envelopes carry
a
meta.tip, and interactive terminals print a one-line tip after each
successful command (hide it with MODA_CLI_TIPS=0).
prompts
Manage code-first prompt versions from your repo.
Runtime calls should use
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
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: