-
Notifications
You must be signed in to change notification settings - Fork 5
Add export CLI command for CSV/JSON data export #13
Copy link
Copy link
Open
Labels
area: cliCLI commands and optionsCLI commands and optionsarea: databaseSQLite schema, queries, and migrationsSQLite schema, queries, and migrationsdifficulty: intermediateRequires some familiarity with the codebaseRequires some familiarity with the codebaseenhancementNew feature or requestNew feature or requesthelp wantedExtra attention is neededExtra attention is needed
Metadata
Metadata
Assignees
Labels
area: cliCLI commands and optionsCLI commands and optionsarea: databaseSQLite schema, queries, and migrationsSQLite schema, queries, and migrationsdifficulty: intermediateRequires some familiarity with the codebaseRequires some familiarity with the codebaseenhancementNew feature or requestNew feature or requesthelp wantedExtra attention is neededExtra attention is needed
Problem
All collected data is locked inside a SQLite database with no CLI or API path to extract it. Users who want to analyze trends in a spreadsheet, share cost data with a team, or back up data before a
clearhave no option.What to do
Add an
exportcommand to the CLI with options:Implementation approach
src/context_analyzer_tool/cli.pywith Typer options:--format:csvorjson(default:csv)--table:events,tasks,snapshots,anomalies(required)--output: file path (default: stdout)--days: limit to last N days (optional)prunecommand does withasyncio.run)csv.DictWriter; for JSON: usejson.dumpFiles to look at
src/context_analyzer_tool/cli.py— follow existing command patternssrc/context_analyzer_tool/db/— existing query functions to reuse