Skip to main content

📋 Command Overview

The ClosedLoop AI CLI provides powerful commands for managing customer feedback analysis:
CommandDescriptionExample
cl ingestSubmit feedback for AI analysiscl ingest "Dashboard is confusing"
cl insightView AI-generated insightscl insight
cl teamManage team settingscl team website "https://example.com"
cl configConfigure API keycl config set --api-key <key>

🔄 Ingest Commands

Submit Customer Feedback

Transform raw customer feedback into structured insights:
# Basic ingestion
cl ingest "The app crashes when I try to upload large files"

# With metadata for better analysis
cl ingest "Great product, love the new features!" \
  --title "Positive Feedback" \
  --customer "customer-456" \
  --name "Jane Smith" \
  --email "jane@example.com" \
  --url "https://support.example.com/ticket/789"

# Wait for AI analysis to complete
cl ingest "Customer complaint about performance" --wait

List Ingested Feedback

# Show all ingested feedback
cl ingest

# With pagination
cl ingest --page 2 --limit 10

# JSON output for scripting
cl ingest --json

View Specific Feedback

# Show detailed feedback information
cl ingest 74e3dd87-878f-41cf-8e5a-87527bbf7770

# JSON output
cl ingest 74e3dd87-878f-41cf-8e5a-87527bbf7770 --json

Ingest Parameters

content
string
required
Customer feedback content to analyze
--title
string
Title for the feedback
--customer
string
Customer identifier
--name
string
Name of person who provided feedback
--email
string
Email of person who provided feedback
--url
string
Source URL (support ticket, survey, etc.)
--wait
flag
Wait for processing to complete
--json
flag
Output in JSON format
--page
number
Page number for listing (default: 1)
--limit
number
Items per page (max 100, default: 20)

📊 Insight Commands

List AI-Generated Insights

View structured insights created by AI analysis:
# Show all insights
cl insight

# With pagination
cl insight --page 2 --limit 5

# JSON output for scripting
cl insight --json

View Specific Insight

# Show detailed insight information
cl insight 2ea8f556-052b-4f5c-bf86-833780b3d00d

# JSON output
cl insight 2ea8f556-052b-4f5c-bf86-833780b3d00d --json

Feedback Parameters

id
string
Insight ID for detailed view
--page
number
Page number for listing (default: 1)
--limit
number
Items per page (max 100, default: 20)
--json
flag
Output in JSON format

👥 Team Commands

Manage Team Website

Why set your product website? ClosedLoop AI uses your product URL to learn about your product features, competitors, pricing, and positioning. This enables more accurate feedback attribution and product-specific insights.
# Show current website
cl team website

# Update team website
cl team website "https://example.com"

# JSON output
cl team website --json

Team Parameters

website
string
Team website URL (must include http:// or https://)
--json
flag
Output in JSON format

⚙️ Configuration Commands

Set API Key

cl config set --api-key your-api-key-here

View Configuration

# Show current configuration
cl config

# JSON output
cl config --json

Configuration Parameters

--api-key
string
Your ClosedLoop AI API key
--json
flag
Output in JSON format

🔧 General Commands

Version Information

cl --version
# Output: 0.2.3

cl version
# Output: 0.2.3

Help

# Main help
cl --help

# Command-specific help
cl help ingest
cl help insight
cl help team

📤 Output Formats

Table Format (Default)

┌─────────────────────────────────────┬─────────────────────────────┬─────────────┬─────────────┐
│ ID                                  │ Title                      │ Status      │ Created     │
├─────────────────────────────────────┼─────────────────────────────┼─────────────┼─────────────┤
│ 74e3dd87-878f-41cf-8e5a-87527bbf7770 │ Dashboard UX Issues        │ completed   │ 2024-01-15  │
│ 2ea8f556-052b-4f5c-bf86-833780b3d00d │ Performance Problems       │ processing  │ 2024-01-15  │
└─────────────────────────────────────┴─────────────────────────────┴─────────────┴─────────────┘

JSON Format

{
  "data": [
    {
      "id": "74e3dd87-878f-41cf-8e5a-87527bbf7770",
      "title": "Dashboard UX Issues",
      "content": "The new dashboard is confusing...",
      "status": "completed",
      "created_at": "2024-01-15T10:30:00Z"
    }
  ],
  "pagination": {
    "page": 1,
    "limit": 20,
    "total": 1,
    "pages": 1
  }
}

❌ Error Handling

Common Error Messages

Error Codes

CodeDescriptionSolution
NO_API_KEYNo API key configuredRun cl config set --api-key <key>
INVALID_API_KEYAPI key is invalidGet new key from http://app.closedloop.sh
VALIDATION_ERRORInput validation failedCheck input format and requirements
API_ERRORServer errorCheck internet connection, try again later
RATE_LIMITEDToo many requestsWait and retry
NOT_FOUNDResource not foundCheck ID is correct

🎯 Best Practices

1. Use Descriptive Titles

# Good
cl ingest "The app crashes when uploading files" --title "File Upload Crash"

# Bad
cl ingest "App broken" --title "Issue"

2. Include Customer Context

# Good
cl ingest "Feature request" --customer "enterprise-123" --name "John Doe"

# Bad
cl ingest "Feature request"

3. Use JSON for Scripting

# Good
cl insight --json | jq '.data[0].title'

# Bad
cl insight | grep "Title"

4. Handle Errors Gracefully

#!/bin/bash
if ! cl ingest "$1" --wait; then
  echo "Failed to ingest feedback"
  exit 1
fi

Ready for Examples?

See real-world usage examples and workflows