Keyboard shortcuts

Press or to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

Chant
intent driven development

Export

Status: Implemented

The chant export command is fully implemented as of v0.3.0. You can export specs to JSON, CSV, and Markdown formats with filtering options.

Design Principle

Chant exports spec data. External tools make reports.

Chant exports raw data → Agents/tools process → Human-readable reports

This keeps chant focused on spec execution, not report generation. See philosophy for the broader approach.

Basic Export

chant export                          # All specs, JSON
chant export --format json            # Explicit JSON
chant export --format csv             # Spreadsheet-friendly
chant export --format markdown        # Simple list

Date Filtering

# Completed in date range
chant export --from 2026-01-01 --to 2026-01-31

# Last N days
chant export --last 30d

# Since specific date
chant export --since 2026-01-01

# Completed this week
chant export --last 7d --status completed

Search Filtering

Use standard search syntax:

chant export --search "status:completed"
chant export --search "label:security"
chant export --search "project:auth"
chant export --search "label:security completed_at:>2026-01-01"

Output Formats

JSON (Default)

$ chant export --last 7d --format json
{
  "exported_at": "2026-01-22T15:00:00Z",
  "query": "completed_at:>2026-01-15",
  "count": 12,
  "specs": [
    {
      "id": "2026-01-22-001-x7m",
      "title": "Add authentication",
      "status": "completed",
      "created_at": "2026-01-20T10:00:00Z",
      "completed_at": "2026-01-20T11:30:00Z",
      "labels": ["feature", "auth"],
      "commit": "abc123",
      "cost": {
        "tokens": 15432,
        "usd": 1.23
      }
    }
  ]
}

CSV

$ chant export --last 7d --format csv
id,title,status,created_at,completed_at,labels,commit,tokens,cost_usd
2026-01-22-001-x7m,Add authentication,completed,2026-01-20T10:00:00Z,2026-01-20T11:30:00Z,"feature,auth",abc123,15432,1.23

Markdown

$ chant export --last 7d --format markdown
# Spec Export
Query: completed_at:>2026-01-15
Count: 12

## 2026-01-22-001-x7m: Add authentication
- Status: completed
- Completed: 2026-01-20
- Labels: feature, auth
- Commit: abc123

## 2026-01-22-002-q2n: Fix payment bug
- Status: completed
- Completed: 2026-01-21
- Labels: bug, payments
- Commit: def456

What Gets Exported

FieldDescription
idSpec ID
titleFirst heading from spec body
statusCurrent status
created_atCreation timestamp
completed_atCompletion timestamp (if completed)
labelsLabels array
projectProject prefix (if set)
commitGit commit hash (if completed)
branchGit branch (if created)
cost.tokensToken count (if tracked)
cost.usdCost in USD (if tracked)
duration_sExecution duration in seconds
agentAgent/model used
promptPrompt used

Selective Fields

# Only specific fields
chant export --fields id,title,status,completed_at

# Exclude cost data
chant export --exclude cost

Piping to Tools

# Count by status
chant export --format json | jq '.specs | group_by(.status) | map({status: .[0].status, count: length})'

# Total cost
chant export --format json | jq '[.specs[].cost.usd] | add'

# Have agent summarize
chant export --last 7d | claude "Summarize this week's completed specs for a standup"

# Generate release notes
chant export --search "label:feature" --from 2026-01-01 | claude "Write release notes from these specs"

Audit Export

For compliance, include full spec bodies:

chant export --full                   # Include spec body content
chant export --full --include-output  # Include agent output too
{
  "specs": [
    {
      "id": "2026-01-22-001-x7m",
      "title": "Add authentication",
      "body": "# Add authentication\n\n## Acceptance Criteria\n...",
      "output": "[10:15:32] Reading src/auth/handler.go\n..."
    }
  ]
}

Git Integration

Export includes git metadata:

chant export --git-details
{
  "specs": [
    {
      "id": "2026-01-22-001-x7m",
      "git": {
        "commit": "abc123",
        "branch": "chant/2026-01-22-001-x7m",
        "author": "alice@example.com",
        "files_changed": ["src/auth/handler.go", "src/auth/jwt.go"],
        "insertions": 145,
        "deletions": 12
      }
    }
  ]
}

Configuration

# config.md
export:
  default_format: json
  include_cost: true
  include_git: false

Examples

Weekly Summary for Standup

chant export --last 7d --status completed --format json | \
  claude "Create a bullet-point summary of what was accomplished this week"

Security Audit Data

chant export --search "label:security" --full --git-details > audit-data.json

Cost Tracking

chant export --last 30d --format csv --fields id,title,tokens,cost_usd > monthly-costs.csv

Release Notes Input

chant export --from 2026-01-01 --to 2026-01-31 --search "label:feature OR label:bugfix" | \
  claude "Write customer-facing release notes from these specs"

Why Not Built-in Reports?

Chant focuses on spec execution. Report generation is:

  1. Highly variable - Every team wants different formats
  2. Better done by agents - LLMs excel at summarization
  3. Already solved - jq, csvkit, pandas, etc.

Export gives you the raw data. Use the right tool for presentation.