Skip to content

fix(cli): ANSI ESC byte + relative-time + login prompt + help grouping#1

Merged
pghqdev merged 1 commit into
mainfrom
cli-color-and-list-polish
May 7, 2026
Merged

fix(cli): ANSI ESC byte + relative-time + login prompt + help grouping#1
pghqdev merged 1 commit into
mainfrom
cli-color-and-list-polish

Conversation

@pghqdev
Copy link
Copy Markdown
Contributor

@pghqdev pghqdev commented May 7, 2026

Four CLI UX changes shipping together as @drdeploy/cli@0.1.5 (patch bump via changeset).

What changed

fix(cli): real ANSI ESC byte in paint()

drdeploy ls was printing literal [36m...[39m text instead of rendering color in TTYs. paint() was building [${open}m${s}[${close}m without the leading \x1b ESC byte, so the terminal saw the bracket sequences as plain text. CI didn't catch it because bun test is non-TTY, which flips supportsColor=false at module load and short-circuits the colored branch entirely. visibleLength's strip regex had the matching bug.

feat(cli): relative-time formatting in drdeploy ls

LAST SCAN column was rendering the raw ISO timestamp 2026-05-07T12:33:37Z. Now compact relative form: 2h ago / moments ago / never. New relativeTime() helper exported from lib/fmt.ts for future commands. Tests pin past, future, null, and unparseable cases.

feat(cli): tighten drdeploy login prompt

Earlier layout printed three URL+code blocks separated by blank lines, pushing users toward manual entry even though the prefilled URL is one click from Approve. New layout leads with the prefilled URL (cyan) and tucks the manual fallback into a dimmed line. Same content, ~50% less vertical space.

feat(cli): group --help into buckets

AUTH / SITES / AI AGENTS / OTHER. Dropped the (planned) status + watch entries until they ship.

Verification

  • bun run --cwd packages/cli test — 24 pass / 0 fail (4 new relativeTime cases)
  • bun run --cwd packages/cli typecheck — clean (after bun run build:libs)
  • Changeset added: .changeset/cli-color-and-list-polish.md (patch)

Release path

After merge, the Release workflow will pick up the changeset, open a 'Version Packages' PR bumping @drdeploy/cli from 0.1.4 → 0.1.5. Merging that publishes the binaries + tags @drdeploy/cli@0.1.5. Homebrew tap formula needs a separate bump to point at the new SHAs.

…ouping

Four CLI UX changes shipping together as @drdeploy/cli@0.1.5:

  • fix: emit real ANSI ESC byte in paint() — 'drdeploy ls' was
    printing literal '[36m...[39m' text instead of rendering color
    in TTYs. The bug hid in CI because bun test is non-TTY, which
    flips supportsColor=false at module load and short-circuits the
    colored branch.

  • feat: relative-time formatting for last_scanned_at — '2h ago',
    'moments ago', 'never' replaces the raw ISO '2026-05-07T12:33:37Z'
    in the LAST SCAN column. New relativeTime() helper in lib/fmt.ts
    is exported for future commands (status, watch).

  • feat: tighten 'drdeploy login' prompt — lead with the one-click
    prefilled URL, tuck manual entry into a dimmed fallback line.
    Same content, ~50% less vertical space.

  • feat: group --help into AUTH / SITES / AI AGENTS / OTHER. Drop
    the (planned) status + watch entries until they ship; listing
    unimplemented commands made the CLI surface look bigger than it
    actually is.
@pghqdev pghqdev merged commit 1d78268 into main May 7, 2026
2 checks passed
@pghqdev pghqdev deleted the cli-color-and-list-polish branch May 7, 2026 13:29
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