Skip to main content

Output Formats

CLEO commands support multiple output formats for different use cases. This reference covers format options and usage patterns.

Format Auto-Detection

CLEO automatically detects the appropriate output format:
ContextDefault Format
Interactive terminal (TTY)Text (human-readable)
Piped output (non-TTY)JSON
Explicit --format flagSpecified format
# Terminal: text output
cleo list

# Piped: JSON output
cleo list | jq '.tasks[]'

# Explicit format
cleo list --format json
cleo list --format text

Available Formats

Flag: --format json or --jsonUse: LLM agents, scripting, data processing
cleo list --json
{
  "_meta": {
    "command": "list",
    "timestamp": "2025-01-19T12:00:00Z"
  },
  "summary": {
    "total": 15,
    "pending": 10,
    "active": 1
  },
  "tasks": [
    {
      "id": "T001",
      "title": "Implement auth",
      "status": "active"
    }
  ]
}

JSON Envelope Structure

All JSON output follows a consistent envelope:
{
  "_meta": {
    "command": "command-name",
    "timestamp": "ISO-8601",
    "version": "0.54.0"
  },
  "summary": {
    // Command-specific summary
  },
  "data": {
    // Main payload (or "tasks", "task", etc.)
  },
  "error": {
    // Present only on error
    "code": "E_NOT_FOUND",
    "message": "Task T999 not found",
    "fix": "cleo list --status pending"
  }
}

Color Control

Disable Colors

# Standard NO_COLOR environment variable
NO_COLOR=1 cleo list

# Also works
CLEO_NO_COLOR=1 cleo list

Force Colors

# Force colors even in piped output
FORCE_COLOR=1 cleo list | less -R

Command-Specific Formats

FormatDescription
textFull task details with colors
jsonComplete task objects
compactOne-line per task
markdownChecklist format
tableASCII table
Default: JSON (designed for LLM agents)
FormatDescription
jsonStructured analysis with scores
humanText summary with recommendations
FormatDescription
csvComma-separated values
tsvTab-separated values
jsonFull JSON export
jsonlJSON Lines (one per line)
FormatDescription
textASCII dashboard
jsonStructured metrics
compactSingle-line summary

LLM Agent Best Practices

Use JSON for Parsing

Always use --json when processing output programmatically

Prefer Native Filters

Use --status, --label, --phase instead of | jq 'select(...)'

Check success Field

Always verify "success": true in JSON responses

Use find for Discovery

cleo find returns minimal output (99% less than list)

Next Steps