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. The same package also ships an MCP server for AI assistants — see MCP Server for that setup.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.| 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 |
--limit | 20 | Max results (1-100) |
--offset | 0 | Pagination offset |
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 |
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://modaflows.com | 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 modaflows.com/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://modaflows.com 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:The same
@moda-ai/cli package also includes an MCP server for AI assistants. See MCP Server for setup instructions.