Willie
02aa2b2a45
feat(cli): add --json output to 8 commands (Phase 1+2)
Add structured JSON output support for agent and CI/CD consumption:
Phase 1 (mutating): sync, install, update, uninstall, collect
Phase 2 (read-only): target list, status, diff
Key design decisions:
- Per-command JSON schema (no universal envelope)
- Shared helper: writeJSON() with recursive nil slice→[] conversion
- --json implies --force for mutating commands (skip prompts)
- TUI/spinners suppressed; progress goes to stderr, JSON to stdout
- 10 integration tests covering valid JSON, dry-run, nil slices
Also includes post-review cleanup:
- ensureEmptySlices now recurses into nested structs/slices
- Unified mode resolution via getTargetMode() (removed 4 duplicates)
- sync --json now creates backups (behavioral parity with non-JSON)
- targetList no longer double-parses --json flag
2026-03-06 02:15:36 +08:00
..
2026-02-28 03:44:02 +08:00
2026-02-25 07:02:54 +08:00
2026-03-03 16:08:11 +08:00
2026-03-02 02:23:50 +08:00
2026-02-21 06:07:35 +08:00
2026-02-25 07:02:54 +08:00
2026-02-26 22:27:23 +08:00
2026-02-28 18:48:51 +08:00
2026-02-16 00:08:59 +08:00
2026-02-11 03:40:54 +08:00
2026-02-25 07:02:54 +08:00
2026-03-02 02:23:50 +08:00
2026-03-05 02:13:21 +08:00
2026-02-16 00:08:59 +08:00
2026-02-16 00:08:59 +08:00
2026-02-11 03:40:54 +08:00
2026-02-13 14:21:37 +08:00
2026-02-13 14:21:37 +08:00
2026-02-24 01:47:38 +08:00
2026-02-28 03:44:02 +08:00
2026-02-23 04:18:01 +08:00
2026-02-21 06:07:35 +08:00
2026-02-18 22:23:50 +08:00
2026-02-18 22:23:50 +08:00
2026-02-18 22:23:50 +08:00
2026-02-27 05:39:49 +08:00
2026-02-25 07:02:54 +08:00
2026-02-18 22:23:50 +08:00
2026-02-18 22:23:50 +08:00
2026-02-25 07:02:54 +08:00
2026-02-23 04:18:01 +08:00
2026-02-24 01:47:38 +08:00
2026-02-25 07:02:54 +08:00
2026-02-24 01:47:38 +08:00
2026-03-06 02:15:36 +08:00
2026-02-21 06:07:35 +08:00
2026-02-25 07:02:54 +08:00
2026-02-25 07:02:54 +08:00
2026-02-26 22:27:23 +08:00
2026-02-16 00:08:59 +08:00
2026-02-24 01:47:38 +08:00
2026-02-11 03:40:54 +08:00
2026-02-22 15:13:10 +08:00
2026-02-21 21:12:51 +08:00
2026-03-02 02:23:50 +08:00
2026-02-27 05:39:49 +08:00
2026-02-13 14:21:37 +08:00
2026-02-11 03:40:54 +08:00
2026-02-16 00:08:59 +08:00
2026-02-16 00:08:59 +08:00
2026-02-11 03:40:54 +08:00
2026-02-27 05:39:49 +08:00
2026-03-04 12:16:32 +08:00
2026-02-16 00:08:59 +08:00
2026-02-26 22:27:23 +08:00
2026-03-02 10:05:57 +08:00
2026-02-20 13:45:52 +08:00
2026-02-25 07:02:54 +08:00
2026-02-16 00:08:59 +08:00
2026-02-21 06:07:35 +08:00
2026-02-21 06:07:35 +08:00
2026-03-02 02:23:50 +08:00
2026-03-04 12:16:32 +08:00
2026-02-16 00:08:59 +08:00
2026-02-16 10:41:14 +08:00
2026-02-25 07:02:54 +08:00
2026-02-27 05:39:49 +08:00
2026-02-16 10:41:14 +08:00
2026-02-21 06:07:35 +08:00
2026-02-23 04:18:01 +08:00
2026-03-03 16:08:11 +08:00
2026-02-26 22:27:23 +08:00
2026-03-03 16:08:11 +08:00
2026-02-16 14:51:13 +08:00
2026-02-11 03:40:54 +08:00
2026-02-16 10:41:14 +08:00