Skip to content

Add JSON and TUI output modes for progress command#5

Merged
dwerner merged 1 commit intomainfrom
progress-tui
Oct 2, 2025
Merged

Add JSON and TUI output modes for progress command#5
dwerner merged 1 commit intomainfrom
progress-tui

Conversation

@dwerner
Copy link
Copy Markdown
Collaborator

@dwerner dwerner commented Oct 2, 2025

Changes to phaser-cli:

  • Add --json and --tui flags (mutually exclusive, TUI is default)
  • Create ProgressOutput and WorkerOutput structs for JSON serialization
  • Implement run_progress_json() that outputs one JSON line per update with RFC3339 timestamps and human-readable durations
  • Implement run_progress_tui() with ratatui showing:
    • Job status panel with ID, status, and block counts
    • Progress bar (Gauge) with percentage, rate, and bytes
    • Workers table with stage, blocks, current block, rate, elapsed
    • Completed workers show ✓ and frozen elapsed time
    • Active workers show live current block and updating elapsed
    • Press 'q' to quit, auto-exit after job completion
  • Add format_duration() helper for human-readable time (e.g., "15m3s")

Dependencies added:

  • chrono for RFC3339 timestamp formatting
  • ratatui for terminal UI
  • crossterm for terminal control

This provides both machine-readable JSON output and a rich interactive TUI for monitoring sync job progress in real-time.

Changes to phaser-cli:
- Add --json and --tui flags (mutually exclusive, TUI is default)
- Create ProgressOutput and WorkerOutput structs for JSON serialization
- Implement run_progress_json() that outputs one JSON line per update
  with RFC3339 timestamps and human-readable durations
- Implement run_progress_tui() with ratatui showing:
  * Job status panel with ID, status, and block counts
  * Progress bar (Gauge) with percentage, rate, and bytes
  * Workers table with stage, blocks, current block, rate, elapsed
  * Completed workers show ✓ and frozen elapsed time
  * Active workers show live current block and updating elapsed
  * Press 'q' to quit, auto-exit after job completion
- Add format_duration() helper for human-readable time (e.g., "15m3s")

Dependencies added:
- chrono for RFC3339 timestamp formatting
- ratatui for terminal UI
- crossterm for terminal control

This provides both machine-readable JSON output and a rich interactive
TUI for monitoring sync job progress in real-time.
@dwerner dwerner marked this pull request as ready for review October 2, 2025 19:06
@dwerner dwerner merged commit 8947357 into main Oct 2, 2025
@dwerner dwerner deleted the progress-tui branch October 2, 2025 19:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant