Skip to main content

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

Installation

npm install -g @moda-ai/cli
Or use without installing:
npx -p @moda-ai/cli moda overview

Agent Skill

Install the Agent Skill so your AI assistant knows how to use the CLI:
npx skills add ModaLabs/moda-cli
Set your API key:
export MODA_API_KEY="moda_sk_your_key_here"

Commands

overview

Get a high-level dashboard of your conversation analytics.
moda overview
moda overview --days-back=30
FlagDefaultDescription
--days-back7Number of days to look back (1-90)
Returns total conversations, trend percentage, frustration rate, tool failure summary, top clusters, and recent activity.

clusters

Browse the topic cluster hierarchy.
moda clusters                              # Root-level categories
moda clusters --parent-id=node-abc         # Drill into a category
moda clusters --time-range=7d              # Filter by time
FlagDefaultDescription
--parent-idParent node ID to drill down (omit for root)
--time-rangeallall, 1h, 3d, 7d, 24h, 30d, 90d

cluster-conversations

List conversations belonging to a specific cluster.
moda cluster-conversations <node_id>
moda cluster-conversations node-abc --limit=20
Argument / FlagDefaultDescription
<node_id>requiredCluster node ID
--limit10Max results (1-100)
--offset0Pagination 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.
moda conversations --search="error"
moda conversations --time-range=24h --environment=production
moda conversations --user-id=user_123 --limit=5
# Positive conversations that mention "enterprise" in their world state
moda conversations --world-state="enterprise" --outcome=positive
# Multiple keywords are ANDed; attach each result's world state
moda conversations --world-state="refund,billing" --include-world-state
FlagDefaultDescription
--searchFull-text search in summaries
--cluster-idFilter by cluster node ID
--user-idFilter by user ID
--time-rangeallall, 1h, 3d, 24h, 7d, 30d, 90d
--environmentallall, development, staging, production
--world-stateKeyword(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).
--outcomeanyany, positive, or negative. positive = a successful, progressing/recovered segment that is not frustrated; negative = the inverse.
--include-world-stateoffAttach each result’s world-state summary (slots + segment summaries).
--limit20Max results (1-100)
--offset0Pagination 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.
moda world-state <conversation_id>
moda world-state <conversation_id> --summary-only
moda world-state <conversation_id> --event-limit=500
Argument / FlagDefaultDescription
<conversation_id>requiredConversation ID
--summary-onlyoffReturn segment summaries only (omit the event stream)
--event-limit2000Max world-state events to return (1-5000)

context

Get a window of messages from a conversation.
moda context <conversation_id>
moda context <conversation_id> --msg-index=5
moda context <conversation_id> --window=3
Argument / FlagDefaultDescription
<conversation_id>requiredConversation ID
--msg-indexmiddleMessage index to center on (0-indexed)
--window2Messages before and after center (1-5)
Returns messages centered around the specified index: window messages before + center message + window messages after.

frustrations

Get user frustration detections with inline evidence.
moda frustrations
moda frustrations --days-back=14 --limit=20
FlagDefaultDescription
--days-back7Number of days to look back (1-90)
--limit10Max results (1-20)
--offset0Pagination offset
Each result includes frustration score, trajectory, primary cause, user quotes, signal breakdown, and inline conversation context.

tool-failures

Get tool failure overview.
moda tool-failures
moda tool-failures --days-back=30
FlagDefaultDescription
--days-back7Number of days to look back (1-90)

tool-failure-detail

Get detailed failure info for a specific tool.
moda tool-failure-detail <tool_name>
moda tool-failure-detail search --subtype=SEARCH_NO_RESULTS
Argument / FlagDefaultDescription
<tool_name>requiredName of the tool to inspect
--subtypeFilter by error subtype
--days-back7Number of days to look back (1-90)
--limit5Max examples (1-20)
--offset0Pagination offset

prompts

Manage code-first prompt versions from your repo.
moda prompts init
moda prompts status
moda prompts diff
moda prompts sync
moda prompts sync --watch
moda prompts promote support.triage --label=prod --version=pver_abc123
CommandEffect
moda prompts initCreates .moda/prompts.yml
moda prompts statusRead-only local status
moda prompts diffRead-only local diff/status
moda prompts syncUploads changed prompt versions and writes .moda/prompts.lock.json
moda prompts sync --watchWatches local prompt files and syncs when hashes change
moda prompts promoteMoves a dev, staging, or prod label to a synced version
Runtime calls should use Moda.prompt(...).render(...) or moda.prompt(...).render(...) so spans include prompt metadata. See Prompt Management.

Common Workflows

Daily Health Check

moda overview --days-back=1
moda frustrations --days-back=1 --limit=5
moda tool-failures --days-back=1

Debugging Frustrated Users

# Find frustrated conversations
moda frustrations --days-back=7

# Get context around the frustration point
moda context <conversation_id> --msg-index=<key_turn>

Investigating Tool Failures

# Which tools are breaking?
moda tool-failures

# What errors? See examples with context
moda tool-failure-detail <tool_name>

Exploring User Intents

# What categories exist?
moda clusters

# Drill into a category
moda clusters --parent-id=node-abc

# See example conversations
moda cluster-conversations node-abc --limit=10

Output

All commands output JSON to stdout. Pipe to jq for filtering:
moda overview | jq '.frustrations'
moda frustrations | jq '.frustrations[].primary_cause'
moda tool-failures | jq '.tools[] | {name: .tool_name, failures: .failure_count}'

Environment Variables

VariableRequiredDefaultDescription
MODA_API_KEYYesYour Moda API key (moda_sk_...)
MODA_BASE_URLNohttps://moda.devBase URL for the Data API

Troubleshooting

Export your API key before running commands:
export MODA_API_KEY="moda_sk_your_key_here"
  • Verify your API key at moda.dev/settings
  • Try --days-back=30 for a wider time range
  • Ensure conversations are being ingested (see Quickstart)
The CLI connects to https://moda.dev by default. Override with MODA_BASE_URL if needed.
Install globally: npm install -g @moda-ai/cli. Or use npx:
npx -p @moda-ai/cli moda overview