Skip to content

✨ feat(cli): colored startup banner from the whale logo#440

Merged
scttbnsn merged 1 commit into
mainfrom
banner/cli-startup
Jun 16, 2026
Merged

✨ feat(cli): colored startup banner from the whale logo#440
scttbnsn merged 1 commit into
mainfrom
banner/cli-startup

Conversation

@scttbnsn

Copy link
Copy Markdown
Contributor

What

drydock now renders a compact colored banner of the whale logo on startup when attached to an interactive terminal, followed by a drydock v<version> · <mode> identity line.

How

  • Build-time bake. scripts/gen-banner.mjs samples the master logo (drydock.png) to a 50-cell-wide grid and renders each terminal row as two pixel rows via the half-block (upper pixel = foreground, lower = background) using 24-bit truecolor escapes. Transparent cells become spaces; blank top/bottom rows are trimmed. The result is baked into app/banner/art.ts so startup decodes no image and pulls in no image library. The generator is deterministic — re-running produces no diff.
  • Render. renderBanner({ mode }) writes the art + identity line to stderr, centering it when the terminal is wider than the banner.
  • Quiet by default where it matters. Suppressed automatically when the stream is not a TTY or when NO_COLOR is set (non-empty), so piped output, log capture, and CI stay clean. Called from the entrypoint for both controller and agent modes.

Tests

  • app/banner/index.test.ts — 11 cases covering TTY gating, NO_COLOR (set / empty / unset), centering vs no-padding vs undefined columns, the stderr/env fallbacks, and identity-line content for both modes.
  • app/index.test.ts — asserts renderBanner runs with { mode: 'controller' } and { mode: 'agent' }.
  • Full app gate green locally: 366 files / 10,875 tests, 100% coverage.

Builds on the new master logo landed in #439.

- 🎨 render the master logo (drydock.png) as a truecolor half-block
  banner on an interactive terminal, followed by a
  `drydock v<version> · <mode>` identity line
- 🔧 art is baked at build time by scripts/gen-banner.mjs (deterministic),
  so startup decodes no image — app/banner/art.ts is generated
- 🔒 written to stderr; auto-suppressed when not a TTY or NO_COLOR is set,
  keeping logs and piped output clean
- ✅ 100% coverage: app/banner/index.test.ts (11 cases) plus entrypoint
  assertions that renderBanner runs for both controller and agent modes
@vercel

vercel Bot commented Jun 16, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
drydock-website Ready Ready Preview, Comment Jun 16, 2026 2:16am
drydockdemo-website Ready Ready Preview, Comment Jun 16, 2026 2:16am

Comment thread scripts/gen-banner.mjs
// ---------------------------------------------------------------------------
// 1. Dump pixels via ImageMagick
// ---------------------------------------------------------------------------
const raw = execSync(`magick ${PNG} -resize ${TARGET_WIDTH}x -depth 8 txt:-`, {
Comment thread scripts/gen-banner.mjs
// 5. Lint/format the generated file
// ---------------------------------------------------------------------------
try {
execSync(`npx @biomejs/biome check --write ${OUT}`, {
@codecov

codecov Bot commented Jun 16, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

@biggest-littlest biggest-littlest left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Clean TTY-gated banner. Art baked at build time so startup pulls in no image decoder, and it's suppressed for non-TTY/NO_COLOR so logs and pipes stay clean. Coverage is full. LGTM.

@ALARGECOMPANY ALARGECOMPANY left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Generator is deterministic, both controller/agent modes are exercised, and the gate is green. Nice touch. Approving.

@scttbnsn scttbnsn merged commit 330a40f into main Jun 16, 2026
24 checks passed
@scttbnsn scttbnsn deleted the banner/cli-startup branch June 16, 2026 02:37
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.

4 participants