Skip to content

Modernize CLI output formatting across all commands #495

Closed

Description

@admarble

Summary

The CLI output uses dated formatting patterns — emoji-heavy status indicators, boxen borders, heavy dividers, and inconsistent visual language across commands. The sequential/chain mode display (ora spinners, phase counters, clean layout) is the modern baseline; parallel mode and most other commands haven't caught up.

Observed: Running sequant run in parallel mode produces noisy output with ● bullets, ⏳ Still running... heartbeats every 60s, and Progress: lines that get corrupted on long runs. Sequential/chain mode (ora ✔/✖, (1/3) counters) is already clean.

Scope

Priority 1: Run command parallel mode (src/commands/run.ts lines 818-957)

Current Target
● #151: exec started Ora spinner or ▸ #151 exec with right-aligned timing
● #151: exec ✓ (46s) ✔ #151 exec 46s (ora succeed)
Progress: #151 ⏳ #152 ✓ #153 ⏳ Compact status line: #151 ✔ #152 ▸ #153 ·
⏳ Still running... (2m elapsed) (every 60s) Suppress or reduce to every 5m; show only when no phase events in window
✓ Issue #152 completed (2m 2s) Fold into phase progress, no separate line
📂 Preparing worktrees from main... Preparing worktrees... (no emoji)
✅ Branch rebased onto origin/main Rebased onto origin/main (no emoji)

Priority 2: CLI UI foundation (src/lib/cli-ui.ts)

These changes propagate to all commands that use the ui namespace:

Element Current Target
headerBox() Boxen with ╭──╮ round borders Bold title only (e.g. sequant run) or minimal single-line rule
divider() Heavy ━━━━━━━━━━ (U+2501) Light ───────── (U+2500)
statusIcon() ✓ / ✗ / ⚠ / ○ / ◐ ✔ / ✖ / ! / · / ▸ — consistent with ora output
phaseProgress() ● / ○ / ✗ / - circles Align with new statusIcon set
Config display Wall of indented chalk.gray() lines Columnar key-value alignment

Priority 3: Run command summary (src/commands/run.ts lines 1071-1135)

Current Target
Double ━━━━━━━━━ dividers around "Summary" Single light ───── divider
Results: 3 passed, 0 failed 3 passed · 0 failed (inline dot separator)
✓ #151: exec → qa → PR #160 (13m 38s) Same structure but with new icon set
📝 Log: .sequant/runs/... Log: .sequant/runs/... (no emoji)
💡 Verify batch integration... Tip: Verify batch integration...

Priority 4: Batch executor sequential display (src/lib/workflow/batch-executor.ts)

  • Line 400: chalk.blue(\\n Issue #${issueNumber}`)` → match new issue header style
  • Line 429: ⚠️ State tracking error → ! State tracking error
  • Lines 454-461: Gray phase detection messages → align with config display style

Priority 5: Other commands

Each command should adopt the updated cli-ui primitives. Specific dated patterns:

Command File Key Issues
init src/commands/init.ts 📦, ⚡, ⚠️ emojis; logDefault() uses 📦; wizard dependency status uses mixed symbols
sync src/commands/sync.ts 🔄, 📢, ✅, 📥, 📄 emojis throughout
update src/commands/update.ts 7+ emoji types (🔄, 📢, 📝, 🌐, ✨, 🔒, ✅); busiest output
state src/commands/state.ts 🔍 header, ✅ confirmations, ⚠️ warnings
status src/commands/status.ts Mixed modern phase symbols + dated ⚠️/✓ emoji
doctor src/commands/doctor.ts Modern boxes but ⚠️ emoji warnings
logs src/commands/logs.ts ✓/✗/~ status indicators
conventions src/commands/conventions.ts ⚠️ warnings, ✅ confirmations
dashboard src/commands/dashboard.ts 📊 header emoji
wizard src/lib/wizard.ts Inconsistent !/✓/✗/○/→ symbols
bin/cli.ts bin/cli.ts ⚠️ local install warning

Priority 6: Worktree manager (src/lib/workflow/worktree-manager.ts)

  • Verbose logging uses raw chalk.gray() — should use colors.muted() from cli-ui
  • Worktree creation/reuse summary messages — align with new style

Design Principles

  1. No emoji in structured output — use typographic symbols (✔, ✖, ▸, ·, !) that align properly in monospace
  2. Ora is the source of truth — success/fail symbols should match what ora produces
  3. Columnar alignment — config key-value pairs should be padded for readability
  4. Minimal chrome — no boxes, light dividers, bold titles instead of bordered headers
  5. Quiet by default — heartbeats only when genuinely idle; phase events are the primary progress signal
  6. Graceful degradation — noColor, non-TTY, CI, and verbose modes must still work

Acceptance Criteria

  • Parallel mode: Phase progress uses ora-consistent symbols; no ● bullets or ⏳ emoji
  • Parallel mode: Heartbeat interval increased to 5m or suppressed when phase events occur within window
  • Parallel mode: Progress line uses new icon set (✔/▸/·), no emoji
  • Header: headerBox() produces a bold title without boxen borders
  • Divider: divider() uses light ─ (U+2500) instead of heavy ━ (U+2501)
  • Status icons: statusIcon() returns ora-consistent symbols across all types
  • Config display: Key-value pairs in run command use columnar alignment
  • Summary: Light divider, no emoji in log/tip lines
  • All commands: No decorative emoji (📦🔄📢📝🌐🔍📊💡📂✅) in structured output
  • Sequential/chain mode: No regression — already-clean display stays clean
  • No-color mode: All new symbols have text fallbacks
  • CI mode: Minimal output still works
  • Non-TTY: Text spinners use updated icon set
  • Existing tests pass; update snapshot tests if any

Non-Goals

  • Changing the information content or control flow of any command
  • Adding new commands or features
  • Changing the ASCII logo or brand colors
  • Animated progress bars or complex TUI elements

Activity

  1. added
    enhancement
    cli
    ui
    complex
    on Apr 6, 2026
  2. admarble commented on Apr 7, 2026

    @admarble
    ContributorAuthor

    Spec Plan — #495: Modernize CLI output formatting

    AC Quality Check

    All 14 AC items are clear and testable. No vague or unmeasurable language detected.


    Scope Assessment

    Non-Goals (from issue):

    • Changing the information content or control flow of any command
    • Adding new commands or features
    • Changing the ASCII logo or brand colors
    • Animated progress bars or complex TUI elements

    Scope Metrics

    Metric Value Status
    Feature count 1 (formatting modernization) ✅
    AC items 14 ❌ Red (≥9)
    File estimate ~21 files ❌ Red (≥13)
    Directory spread 4 (src/commands/, src/lib/, src/lib/workflow/, bin/) ⚠️ Yellow

    Verdict: ❌ SCOPE_SPLIT_RECOMMENDED — 14 AC items across 21 files is high, but this is a single cohesive change (formatting consistency) with no behavioral changes. The issue explicitly defines 6 priority tiers for incremental implementation. Quality Loop: auto-enabled.


    Acceptance Criteria

    AC-1: Parallel mode phase progress symbols

    Verification: Integration Test

    • Given: run.ts parallel mode callback onPhaseProgress
    • When: Phase starts/completes/fails
    • Then: Uses ▸/✔/✖ instead of ● bullets; no ⏳ emoji

    AC-2: Heartbeat interval

    Verification: Unit Test

    • Given: Parallel mode heartbeat timer
    • When: Timer fires
    • Then: Interval is 300,000ms (5m) instead of 60,000ms; suppressed when recent phase events occurred

    AC-3: Parallel progress line icons

    Verification: Unit Test

    • Given: renderProgressLine() in run.ts
    • When: Rendering status for each issue
    • Then: Uses ✔/▸/· — no emoji characters

    AC-4: headerBox without boxen

    Verification: Unit Test

    • Given: headerBox("Title")
    • When: Called in TTY mode
    • Then: Returns bold title text without ╭──╮ borders; boxen dependency can be removed from headerBox path

    AC-5: Light divider

    Verification: Unit Test

    • Given: divider(50)
    • When: Called in TTY mode
    • Then: Uses ─ (U+2500) not ━ (U+2501)

    AC-6: statusIcon ora-consistent

    Verification: Unit Test

    • Given: statusIcon("success" | "error" | "warning" | "pending" | "running")
    • When: Called
    • Then: Returns ✔/✖/!/·/▸ respectively (matching ora output)

    AC-7: Config display columnar

    Verification: Manual Test

    • Given: sequant run config display section (lines 492-535)
    • When: Config is printed
    • Then: Key-value pairs are padded for columnar alignment

    AC-8: Summary formatting

    Verification: Unit Test

    • Given: Run summary section (lines 1071-1135)
    • When: Summary is printed
    • Then: Light ─ divider; Log: without 📝; Tip: without 💡; 3 passed · 0 failed inline format

    AC-9: No decorative emoji

    Verification: Integration Test (grep)

    • Given: All source files in src/commands/, src/lib/workflow/, bin/
    • When: Grep for decorative emoji (📦🔄📢📝🌐🔍📊💡📂✅⚠️✨🔒⏳📥📄)
    • Then: Zero matches in structured output code (test files and AC-parsing exempt)

    AC-10: Sequential/chain no regression

    Verification: Integration Test

    • Given: Sequential mode already uses ora spinners
    • When: Running sequential mode
    • Then: Output unchanged — no new symbols introduced, no removed symbols

    AC-11: No-color text fallbacks

    Verification: Unit Test

    • Given: configureUI({ noColor: true })
    • When: All statusIcon/phaseProgress/divider calls
    • Then: Returns ASCII text fallbacks (e.g., [OK], [FAIL], [..], [-])

    AC-12: CI mode

    Verification: Unit Test

    • Given: configureUI({ isCI: true })
    • When: Any UI function called
    • Then: Minimal output, no ANSI escapes, no animations

    AC-13: Non-TTY spinners

    Verification: Unit Test

    • Given: TextSpinner class, non-TTY mode
    • When: start/succeed/fail/warn called
    • Then: Uses ▸/✔/✖/! (new icon set), not ⏳/✓/✗/⚠

    AC-14: Tests pass

    Verification: Integration Test

    • Given: Full test suite
    • When: npm test
    • Then: All pass; cli-ui.test.ts updated for new symbols

    Implementation Plan

    Phase 1: CLI UI Foundation (Priority 2 — do first, others depend on it)

    1. Update statusIcon() in src/lib/cli-ui.ts (line 566-594)

      • Change color symbols: ✓→✔, ✗→✖, ⚠→!, ○→·, ◐→▸
      • Update noColor fallbacks to match
    2. Update divider() in src/lib/cli-ui.ts (line 611-617)

      • Change ━ (U+2501) → ─ (U+2500)
    3. Update headerBox() in src/lib/cli-ui.ts (line 427-430)

      • Remove boxen wrapping; return bold title + optional light rule
      • Keep non-TTY fallback returning plain text
    4. Update phaseProgress() in src/lib/cli-ui.ts (line 644-665)

      • Change ●→✔, ✗→✖, ◐→▸, ○→·
    5. Update TextSpinner class (line 216-264)

      • start(): ⏳→▸
      • succeed(): ✓→✔
      • fail(): ✗→✖
      • warn(): ⚠→!
    6. Update successBox/errorBox/warningBox (lines 403-422)

      • Remove emoji prefixes (✅, ❌, ⚠️)
      • Use typographic symbols instead
    7. Update cli-ui.test.ts — Adjust assertions for new symbols

    Phase 2: Run Command Parallel Mode (Priority 1)

    1. Update onPhaseProgress callback (run.ts lines 873-884)

      • Replace ● with ▸/✔/✖ based on event type
      • Remove ✓/✗ emoji suffixes
    2. Update renderProgressLine (run.ts lines 818-826)

      • Replace ✓/⏳ with ✔/▸/·
    3. Update heartbeat (run.ts lines 888-895)

      • Change interval from 60,000ms to 300,000ms
      • Replace ⏳ with plain text
      • Add suppression logic when phase events occurred recently
    4. Update per-issue completion (run.ts lines 843-860)

      • Fold into phase progress (remove separate "Issue completed" line) or use new icon set

    Phase 3: Run Command Summary + Config (Priority 3)

    1. Update summary section (run.ts lines 1071-1135)

      • Light divider (already uses ui.divider() so Phase 1 covers this)
      • Replace 📝 Log: → Log:
      • Replace 💡 Verify... → Tip: Verify...
      • Inline result format: 3 passed · 0 failed
    2. Update config display (run.ts lines 492-535)

      • Add columnar padding for key-value alignment
      • Replace ⚠️ in dry run / warnings with !

    Phase 4: Batch Executor + Worktree Manager (Priority 4, 6)

    1. Update batch-executor.ts (line 429)

      • Replace ⚠️ with !
    2. Update worktree-manager.ts (~38 emoji instances)

      • 📂→remove, 🔄→remove, ✅→✔, ⚠️→!, 📦→remove, 📊→remove
      • Use colors.muted() where raw chalk.gray() is used
    3. Update log-writer.ts (6 instances)

      • Replace all 📝 prefixes with plain text

    Phase 5: All Other Commands (Priority 5)

    1. init.ts (9 instances) — Replace 📦→remove, ⚠️→!, 🔍→remove
    2. sync.ts (8 instances) — Replace 🔄→remove, 📢→remove, ✅→✔, 📥→remove, 📄→remove, ⚠️→!
    3. update.ts (16 instances) — Replace all 7+ emoji types with text equivalents
    4. state.ts (3 instances) — Replace 🔍→remove, 🔄→remove, 📊→remove
    5. status.ts (9 instances) — Replace ⚠️→!, 📊→remove
    6. doctor.ts (1 instance) — Replace ⚠️→!
    7. logs.ts (1 instance) — Replace 📝→remove
    8. dashboard.ts (1 instance) — Replace 📊→remove
    9. bin/cli.ts (1 instance) — Replace ⚠️→!
    10. wizard.ts — Already mostly clean; verify !/✓/✗/○/→ match new set
    11. Other workflow files — phase-executor.ts, metrics-writer.ts, state-manager.ts, state-rebuild.ts, state-cleanup.ts

    Phase 6: Verification

    1. Run full test suite, update broken assertions
    2. Verify no-color, CI, non-TTY modes
    3. Grep for remaining emoji to ensure zero decorative emoji

    Design Review

    1. Where does this logic belong? Primarily src/lib/cli-ui.ts (centralized UI primitives) plus consumers in src/commands/ and src/lib/workflow/. The cli-ui module is the single source of truth for symbols — commands that use raw chalk + emoji get migrated to use cli-ui exports.

    2. What's the simplest correct approach? Change the symbol constants in cli-ui.ts first, then find-and-replace emoji in consumers. No new abstractions needed. The existing statusIcon(), divider(), phaseProgress() APIs stay the same — only return values change.

    3. What existing pattern does this follow? Sequential/chain mode already uses ora spinners with ✔/✖. This extends that pattern to parallel mode and all commands. The TextSpinner class mirrors ora's API — aligning its symbols to match ora output.

    4. What would a senior reviewer challenge? (1) "Why not extract all symbols into a single config object?" — Overkill; statusIcon() already centralizes access. (2) "Should boxen be fully removed?" — Only from headerBox(); box() still uses it for success/error/warning boxes. (3) "Can the heartbeat suppression add complexity?" — Keep it simple: just track last phase event timestamp.


    Feature Quality Planning

    Completeness Check

    • All 14 AC items have implementation steps
    • Integration points: cli-ui.ts → all consumers
    • No partial implementations planned
    • No state management involved
    • Data flow: symbol constants → rendering functions → console output

    Error Handling

    • No new error scenarios (purely cosmetic)
    • Graceful degradation already handled (noColor, non-TTY, CI, Windows)

    Code Quality

    • No new types needed
    • Follows existing patterns (cli-ui module)
    • No magic strings — symbols defined in statusIcon/phaseProgress functions
    • Consistent naming conventions

    Test Coverage Plan

    • Update cli-ui.test.ts for new symbol values
    • Verify run.test.ts passes (no snapshot tests for output)
    • Add grep-based regression test for decorative emoji

    Best Practices

    • No logging changes (only formatting)
    • Security: N/A (no user input)
    • Documentation: update if CLI output examples exist in docs

    Derived ACs

    None — the 14 AC items cover all required changes.


    Open Questions

    1. headerBox boxen removal scope

      • Recommendation: Remove boxen only from headerBox(). Keep it for successBox/errorBox/warningBox since those are used for important notices.
      • Impact: If removed everywhere, boxen dependency could be dropped entirely.
    2. Heartbeat suppression vs interval increase

      • Recommendation: Increase to 5m AND suppress if a phase event occurred in the last 60s. Simple: track lastPhaseEventTime.
      • Impact: Without suppression, heartbeat can still feel noisy in rapid-phase scenarios.

    Recommended Workflow

    Phases: spec → exec → qa
    Quality Loop: enabled (auto-enabled due to scope: 14 AC, 21 files)
    Reasoning: No browser UI involved (CLI output formatting). Skip /test phase. Quality loop warranted due to high file count — easy to miss an emoji in one of 21 files.


    Label Review

    Current: enhancement, cli, ui, complex
    Recommended: No changes needed. complex label correctly reflects the scope. ui label present but this is CLI-only (no browser test needed due to no .tsx changes).
    Quality Loop: Auto-enabled due to complex label.


    Conflict Risk Analysis

    In-flight worktrees: #483, #485, #486 — all have zero diffs from main (just started). No file overlap risk.

  3. added
    planned
    on Apr 7, 2026
  4. added a commit that references this issue on Apr 7, 2026
  5. admarble commented on Apr 7, 2026

    @admarble
    ContributorAuthor

    QA Review for Issue #495

    AC Coverage

    AC Description Status Evidence
    AC-1 Parallel phase progress ora symbols MET ▸/✔/✖ in onPhaseProgress, no ● or ⏳
    AC-2 Heartbeat 5m + suppression MET HEARTBEAT_INTERVAL_MS=300000, HEARTBEAT_SUPPRESS_MS=60000, lastPhaseEventTime tracking
    AC-3 Progress line new icons MET ✔/· in renderProgressLine, no emoji
    AC-4 headerBox bold title, no boxen MET Returns getColor(chalk.bold)(title) directly
    AC-5 Light divider MET \u2500 (─) replaces \u2501 (━)
    AC-6 statusIcon ora-consistent MET ✔/✖/!/·/▸ for success/error/warning/pending/running
    AC-7 Config columnar alignment MET pad() helper with 15-char column width
    AC-8 Summary no emoji MET Log: and Tip: without emoji, inline N passed · N failed
    AC-9 No decorative emoji MET grep across all 22 files returns zero matches
    AC-10 Sequential/chain no regression MET Sequential mode uses ora spinners (unchanged); 2410 tests pass
    AC-11 No-color text fallbacks MET [OK]/[FAIL]/[WARN]/[ ]/[..] retained in noColor mode
    AC-12 CI mode minimal output MET config.minimal/config.isCI guards unchanged; jsonMode returns ""
    AC-13 Non-TTY updated icons MET TextSpinner: ▸/✔/✖/! in start/succeed/fail/warn
    AC-14 Tests pass MET 2410/2410 pass, 0 failures; cli-ui.test.ts (73 tests) updated

    Coverage: 14/14 AC items fully met


    Quality Metrics

    Metric Value Status
    Type issues (any) 0 OK
    Deleted tests 0 OK
    Files changed 22 OK (cosmetic changes across commands)
    Lines added +1121 -
    Lines deleted -866 -
    Security patterns 0 OK

    Test Coverage

    Changed File Has Tests? Notes
    src/lib/cli-ui.ts Yes (73 tests) Core file - all assertions updated
    src/commands/run.ts Yes Integration tests pass
    src/lib/workflow/batch-executor.ts Yes Unit tests pass
    bin/cli.ts, dashboard, logs, update No direct tests Cosmetic emoji removal only
    worktree-manager.ts No direct tests Cosmetic emoji removal only

    Note: Files without direct tests received only cosmetic changes (emoji→text). The core logic file cli-ui.ts has comprehensive test coverage.


    Code Review

    Strengths:

    • Clean, focused changes — only symbol/formatting changes, no behavioral changes
    • Consistent symbol set across all 22 files
    • Heartbeat suppression logic is simple and correct (timestamp comparison)
    • Columnar padding is pragmatic (single pad() helper, 15-char width)

    Issues:

    • None blocking

    Suggestions (non-blocking):

    • The remaining emoji in scope/formatter.ts, ac-linter.ts, ci/outputs.ts are in GitHub markdown generators — correctly left as-is since they render in GitHub UI, not terminal

    Self-Evaluation

    • Verified working: Yes — build passes, 2410 tests pass, grep confirms zero decorative emoji
    • Test efficacy: High — cli-ui.test.ts covers all changed functions with specific symbol assertions
    • Likely failure mode: A future contributor adds emoji to a new command without knowing about this convention
    • Verdict confidence: High — purely cosmetic changes, comprehensive test pass

    CHANGELOG Verification

    Check Status
    CHANGELOG.md exists Found
    User-facing changes Yes
    [Unreleased] entry Present (#495)
    Entry format Valid

    Verdict: READY_FOR_MERGE

    All 14 AC items met. Purely cosmetic formatting changes with zero behavioral impact. Build, lint, and all 2410 tests pass. CI typecheck and validation checks passing; build checks in progress.

  6. added
    ready-for-review
    on Apr 7, 2026
  7. added a commit that references this issue on Apr 7, 2026
  8. admarble commented on Apr 8, 2026

    @admarble
    ContributorAuthor

    Documentation Generated

    File: docs/features/cli-output-formatting.md

    Sections Included:

    • Design Principles (6 rules)
    • Symbol Reference (status icons, phase progress, dividers, headers)
    • Environment Modes (TTY, non-TTY, no-color, CI, JSON, verbose)
    • Parallel Mode Output (with example)
    • Config Display (columnar format example)
    • Extending (conventions for new CLI output)
    • Troubleshooting (Unicode support, CI verbosity)

    Next Steps:

    1. Review generated documentation for accuracy
    2. Commit to main or feature branch

    Documentation complete!

  9. added a commit that references this issue on Apr 8, 2026
  10. added 2 commits that reference this issue on Apr 23, 2026
  11. added a commit that references this issue on Sep 9, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    clicomplexenhancementplannedready-for-reviewui

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions