Files
skillshare/tests/integration
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
..