codexmate
codexmate copied to clipboard
feat(analytics): export usage data as CSV or JSON
Requirements
Export usage data (token consumption, session count, model breakdown) as CSV or JSON for external BI analysis or archival. Support filtering by date range and model type.
Verification
- Run
/analytics export --format csv --from 2026-05-01 --to 2026-05-06 - Verify a CSV file is downloaded with correct columns (date, model, tokens, sessions)
- Import the CSV into a spreadsheet tool and verify all rows are present and correctly formatted
- Run
/analytics export --format jsonand verify JSON structure matches the CSV data - Verify the command handles empty data gracefully (empty file, no crash)
This feature request has been reviewed and prioritized.
Assessment:
- High value for power users and data analysis workflows
- Implementation complexity: Low-Medium - export functionality exists in other modules
- Dependencies: Analytics data collection (partially in place)
Proposed approach:
- Add CSV/JSON export endpoint to analytics API
- Support date range and model filtering
- Include token consumption, session count, and model breakdown
Will be considered for next sprint planning.