Commit 101b803
authored
feat: add --format json option to canonical command (#117)
* feat(cli): add --format json option to canonical command
Add JSON output support to the 'canonical' subcommand to enable
machine-readable access to canonical events. This supports the
ActivityWatch × AI agent enablement workflow, allowing agents to
consume categorized activity data without reimplementing the canonical
query.
- Add --format option with 'table' (default) and 'json' choices
- JSON output emits event array with ISO-8601 timestamps
- Preserves existing table format behavior (human-readable)
Closes: ActivityWatch/aw-client contribution for agent enablement.
Reference: https://github.com/ActivityWatch/aw-client/issues (agent enablement docs)
* fix(cli): serialize canonical durations as seconds1 parent 2c88b87 commit 101b803
1 file changed
Lines changed: 40 additions & 19 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
236 | 236 | | |
237 | 237 | | |
238 | 238 | | |
| 239 | + | |
| 240 | + | |
| 241 | + | |
| 242 | + | |
| 243 | + | |
| 244 | + | |
239 | 245 | | |
240 | 246 | | |
241 | 247 | | |
242 | 248 | | |
243 | 249 | | |
244 | 250 | | |
245 | 251 | | |
| 252 | + | |
246 | 253 | | |
247 | 254 | | |
248 | 255 | | |
| |||
270 | 277 | | |
271 | 278 | | |
272 | 279 | | |
273 | | - | |
274 | 280 | | |
275 | | - | |
276 | 281 | | |
277 | | - | |
278 | | - | |
279 | | - | |
280 | | - | |
281 | | - | |
282 | | - | |
283 | | - | |
284 | | - | |
285 | | - | |
286 | | - | |
287 | | - | |
| 282 | + | |
| 283 | + | |
| 284 | + | |
| 285 | + | |
| 286 | + | |
| 287 | + | |
| 288 | + | |
| 289 | + | |
| 290 | + | |
| 291 | + | |
| 292 | + | |
| 293 | + | |
| 294 | + | |
| 295 | + | |
| 296 | + | |
| 297 | + | |
| 298 | + | |
| 299 | + | |
| 300 | + | |
| 301 | + | |
| 302 | + | |
| 303 | + | |
| 304 | + | |
| 305 | + | |
| 306 | + | |
| 307 | + | |
| 308 | + | |
| 309 | + | |
288 | 310 | | |
289 | | - | |
290 | 311 | | |
291 | | - | |
292 | | - | |
293 | | - | |
294 | | - | |
295 | | - | |
| 312 | + | |
| 313 | + | |
| 314 | + | |
| 315 | + | |
| 316 | + | |
296 | 317 | | |
297 | 318 | | |
298 | 319 | | |
| |||
0 commit comments