Skip to content

feat: enhance animated CLI banner with branding and fixes#198

Merged
benym merged 19 commits into
masterfrom
optimize_cli
Jul 12, 2026
Merged

feat: enhance animated CLI banner with branding and fixes#198
benym merged 19 commits into
masterfrom
optimize_cli

Conversation

@benym

@benym benym commented Jul 12, 2026

Copy link
Copy Markdown
Contributor

✨ Summary

🎯 Scope

  • CLI commands (init, status, doctor, update)
  • Core installer / platform detection
  • Comet skills (assets/skills/, assets/skills-zh/)
  • Comet shell scripts (assets/skills/comet/scripts/)
  • Tests / CI
  • Documentation / changelog
  • Other:

🧪 Testing

  • pnpm build
  • pnpm lint
  • pnpm run lint:architecture
  • pnpm format:check
  • pnpm test
  • pnpm test -- test/domains/comet-classic/comet-scripts.test.ts
  • Not run:

✅ Checklist

  • PR title follows Conventional Commits, for example fix: handle project-scope init
  • User-facing behavior is documented in README.md, README-zh.md, or CONTRIBUTING.md
  • CHANGELOG.md is updated when behavior changes
  • Skill changes were made in Chinese first when applicable, then synced to English
  • New scripts are included in assets/manifest.json and relevant tests
  • Shell scripts remain portable across macOS, Linux, and Windows Git Bash
  • No unrelated generated files or local artifacts are included

👀 Notes for Reviewers

Summary by Sourcery

Introduce a branded, animated CLI banner for comet init and align CLI/package branding around a new tagline while keeping JSON and non-interactive output stable.

New Features:

  • Add a dedicated CLI banner module that renders and animates a branded Comet logo and tagline during interactive comet init runs.

Enhancements:

  • Wire comet init to await the banner before printing version information and reuse the shared tagline constant in the main CLI description.
  • Improve banner robustness by detecting terminal capabilities, falling back to a static banner in automated or non-TTY environments, and safely handling output errors.

Documentation:

  • Document the CLI banner animation design and implementation plan under the superpowers specs, and note the new brand experience in the changelog.

Tests:

  • Add unit tests for banner rendering, animation behavior, environment fallbacks, and stream error handling, and extend CLI help tests to assert the new tagline and package metadata consistency.

Summary by CodeRabbit

  • New Features

    • Added the branded “Comet” banner animation to comet init in compatible interactive terminals, with centered logo over the tagline and a timed multi-phase reveal.
    • Added a static, color-safe fallback for narrow, non-TTY/automated, NO_COLOR, or non-ANSI environments.
    • Updated the CLI and package tagline to “Agent Skill Harness For Turning Ideas Into Evaluated Workflows.”
    • Banner remains suppressed in JSON mode.
  • Documentation

    • Added a release note plus plan/spec documentation for the CLI banner experience.
  • Tests

    • Expanded coverage for animation rendering, fallbacks, terminal-width rules, error handling, and CLI integration.

@sourcery-ai

sourcery-ai Bot commented Jul 12, 2026

Copy link
Copy Markdown

Reviewer's Guide

Adds a new animated Comet CLI banner module, wires it into comet init, and aligns CLI/package branding and tests with the new tagline and behavior, including robust fallbacks for non-interactive or JSON output.

Sequence diagram for comet init and animated CLI banner

sequenceDiagram
  participant User
  participant InitCommand
  participant CometBanner
  participant TerminalRuntime

  User->>InitCommand: initCommand(targetPath, options)
  InitCommand->>CometBanner: printCometBanner({ enabled: !options.json })
  CometBanner->>TerminalRuntime: read isTTY/env/getColumns
  CometBanner->>CometBanner: canAnimateCometBanner(runtime)

  alt [options.enabled === false]
    CometBanner-->>InitCommand: return (no banner)
  else [canAnimateCometBanner == false]
    CometBanner->>TerminalRuntime: write("\n" + renderCometBanner() + "\n\n")
    CometBanner-->>InitCommand: return
  else [canAnimateCometBanner == true]
    CometBanner->>TerminalRuntime: write("\n")
    loop timeline()
      CometBanner->>CometBanner: renderCometAnimationFrame(phase, progress)
      CometBanner->>TerminalRuntime: write(replaceFrame(frame, first))
      CometBanner->>TerminalRuntime: sleep(FRAME_DELAY_MS)
    end
    CometBanner->>CometBanner: renderCometBanner({ color: true })
    CometBanner->>TerminalRuntime: write(replaceFrame(stableFrame, false))
    CometBanner->>TerminalRuntime: write(RESET + "\n")
    CometBanner-->>InitCommand: return
  end

  InitCommand->>InitCommand: printVersionInfo(log) (when !options.json)
  InitCommand-->>User: init completes
Loading

Flow diagram for canAnimateCometBanner decision

flowchart TD
  Start([Start]) --> CheckEnabled{enabled === false?}
  CheckEnabled -- yes --> Static[Skip banner]
  CheckEnabled -- no --> IsTTY{runtime.isTTY?}
  IsTTY -- no --> Static
  IsTTY -- yes --> CI{CI env set and not 'false'?}
  CI -- yes --> Static
  CI -- no --> NO_COLOR{NO_COLOR in env?}
  NO_COLOR -- yes --> Static
  NO_COLOR -- no --> TermDumb{TERM == dumb?}
  TermDumb -- yes --> Static
  TermDumb -- no --> Columns{columns >= BANNER_WIDTH?}
  Columns -- no --> Static
  Columns -- yes --> Animated[Use animated banner]

  Static --> End([Render static renderCometBanner])
  Animated --> EndAnimated([Run printCometBanner animation timeline])
Loading

File-Level Changes

Change Details Files
Introduce a dedicated, testable animated CLI banner module with environment-aware fallbacks.
  • Add COMET_TAGLINE/COMET_LOGO constants plus static banner rendering with optional color
  • Implement a three-phase (preheat/sweep/settle) banner animation with particle effects and RGB color gradients
  • Add environment and terminal capability checks (TTY, CI, NO_COLOR, TERM, width) via canAnimateCometBanner
  • Provide printCometBanner with injectable runtime (write/sleep/columns) and robust fallback to static output on failure
  • Introduce createBannerStreamWriter to safely wrap Writable streams and swallow async write errors
  • Add comprehensive tests for layout, color codes, animation timing, environment downgrade behavior, and error handling
app/cli/comet-banner.ts
test/app/comet-banner.test.ts
Wire the banner into comet init while preserving JSON-mode behavior and ordering relative to version info.
  • Replace inline COMET banner ASCII art in init.ts with an async call to printCometBanner
  • Ensure banner is enabled for text output and disabled for JSON output via enabled flag
  • Guarantee init waits for the banner to finish before printing version info, with tests verifying call order
  • Mock comet-banner in E2E tests to assert integration behavior without running the real animation
app/commands/init.ts
test/app/init-e2e.test.ts
Align CLI help and package metadata with the new tagline and verify via tests.
  • Export COMET_TAGLINE from comet-banner and reuse it for Commander program.description
  • Update package.json description to the new evaluated-workflows tagline
  • Extend CLI help tests to assert the tagline appears in CLI output and matches package metadata
  • Add version consistency checks between package.json and package-lock.json in CLI help tests
app/cli/index.ts
test/app/cli-help.test.ts
package.json
Document the CLI banner animation design and implementation plan and summarize user-visible branding changes in the changelog.
  • Add a changelog entry describing the new animated CLI brand experience and tagline usage
  • Introduce a detailed implementation plan for the CLI banner animation under superpowers/plans
  • Add a design spec describing animation goals, constraints, interactions, architecture, and non-goals
CHANGELOG.md
docs/superpowers/plans/2026-07-12-cli-banner-animation.md
docs/superpowers/specs/2026-07-12-cli-banner-animation-design.md

Tips and commands

Interacting with Sourcery

  • Trigger a new review: Comment @sourcery-ai review on the pull request.
  • Continue discussions: Reply directly to Sourcery's review comments.
  • Generate a GitHub issue from a review comment: Ask Sourcery to create an
    issue from a review comment by replying to it. You can also reply to a
    review comment with @sourcery-ai issue to create an issue from it.
  • Generate a pull request title: Write @sourcery-ai anywhere in the pull
    request title to generate a title at any time. You can also comment
    @sourcery-ai title on the pull request to (re-)generate the title at any time.
  • Generate a pull request summary: Write @sourcery-ai summary anywhere in
    the pull request body to generate a PR summary at any time exactly where you
    want it. You can also comment @sourcery-ai summary on the pull request to
    (re-)generate the summary at any time.
  • Generate reviewer's guide: Comment @sourcery-ai guide on the pull
    request to (re-)generate the reviewer's guide at any time.
  • Resolve all Sourcery comments: Comment @sourcery-ai resolve on the
    pull request to resolve all Sourcery comments. Useful if you've already
    addressed all the comments and don't want to see them anymore.
  • Dismiss all Sourcery reviews: Comment @sourcery-ai dismiss on the pull
    request to dismiss all existing Sourcery reviews. Especially useful if you
    want to start fresh with a new review - don't forget to comment
    @sourcery-ai review to trigger a new review!

Customizing Your Experience

Access your dashboard to:

  • Enable or disable review features such as the Sourcery-generated pull request
    summary, the reviewer's guide, and others.
  • Change the review language.
  • Add, remove or edit custom review instructions.
  • Adjust other review settings.

Getting Help

@coderabbitai

coderabbitai Bot commented Jul 12, 2026

Copy link
Copy Markdown

Review Change Stack

📝 Walkthrough

Walkthrough

The CLI adds a shared Comet banner renderer with animated TTY playback, static fallbacks, and JSON suppression. Init, CLI help, package metadata, changelog, tests, design documents, and the website subproject reference are updated.

Changes

Comet banner experience

Layer / File(s) Summary
Banner rendering and visual contract
app/cli/comet-banner.ts, docs/superpowers/plans/..., docs/superpowers/specs/..., test/app/comet-banner.test.ts
Defines the logo, tagline, centered layout, color gradients, animation phases, and rendered frames, with tests for visual output and ANSI behavior.
Terminal-aware animation playback
app/cli/comet-banner.ts, test/app/comet-banner.test.ts, docs/superpowers/plans/...
Adds TTY/environment gating, timed playback, terminal-width checks, cleanup, write-error handling, and static fallback behavior.
Init command integration
app/commands/init.ts, test/app/init-e2e.test.ts, docs/superpowers/plans/...
Uses the shared banner printer during text-mode init, disables it for JSON output, and verifies asynchronous ordering.
CLI and package branding
app/cli/index.ts, package.json, CHANGELOG.md, test/app/cli-help.test.ts, docs/superpowers/plans/...
Synchronizes the tagline across CLI help, package metadata, changelog content, and release metadata tests.

Website subproject reference

Layer / File(s) Summary
Website commit reference
website
Updates the recorded website subproject commit.

Estimated code review effort: 4 (Complex) | ~45 minutes

Sequence Diagram(s)

sequenceDiagram
  participant InitCommand
  participant printCometBanner
  participant TerminalRuntime
  participant Stdout
  InitCommand->>printCometBanner: printCometBanner(enabled: !json)
  printCometBanner->>TerminalRuntime: check TTY, environment, and width
  alt animation supported
    printCometBanner->>Stdout: write animation frames
    printCometBanner->>TerminalRuntime: sleep between timeline frames
    printCometBanner->>Stdout: write stable colorized banner
  else fallback
    printCometBanner->>Stdout: write static banner
  end
  InitCommand->>InitCommand: continue init after banner completes
Loading
🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately summarizes the main change: a branded animated CLI banner with related fixes and fallbacks.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch optimize_cli

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@greptile-apps

greptile-apps Bot commented Jul 12, 2026

Copy link
Copy Markdown

Greptile Summary

This PR adds a branded Comet banner experience to the CLI. The main changes are:

  • New banner rendering and animation support for comet init.
  • Static fallback output for JSON, CI, narrow, colorless, or non-TTY runs.
  • Shared tagline updates in CLI help and package metadata.
  • Tests and docs for the new banner behavior.

Confidence Score: 4/5

This is close, but the banner alignment issue should be fixed before merging.

  • Wide interactive terminals still render the banner from column 0.
  • The terminal width is only used as a fit check, not to position the frame.
  • JSON output and the import surfaces look stable.

app/cli/comet-banner.ts

Important Files Changed

Filename Overview
app/cli/comet-banner.ts Adds banner rendering, animation, environment detection, and fallback output; wide-terminal centering still needs a code change.
app/commands/init.ts Connects comet init to the banner entry point while keeping JSON output disabled.
app/cli/index.ts Uses the shared Comet tagline for the root CLI description.
test/app/comet-banner.test.ts Adds coverage for rendering, animation fallback, stream errors, and current alignment behavior.

Reviews (2): Last reviewed commit: "docs: align CLI banner color contract" | Re-trigger Greptile

Comment thread app/cli/comet-banner.ts
Comment thread website

@sourcery-ai sourcery-ai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Hey - I've left some high level feedback:

  • app/cli/comet-banner.ts has grown quite large and mixes pure rendering, animation timing, and I/O concerns; consider splitting it into a pure rendering module and a small runtime/IO adapter so the animation logic is easier to follow and maintain.
  • The BannerRuntime/getColumns/readColumns/animationFrameForRuntime chain is fairly indirect and throws on width changes; you could simplify by reading columns once per frame and passing the width into the renderer, turning width changes into a graceful static fallback instead of an exception path.
  • renderCometBannerFrame now just wraps renderCometAnimationFrame('sweep', …) and is only used in tests; if there is no external dependency on it, consider making this an internal helper or inlining it to keep the public API surface of comet-banner.ts smaller.
Prompt for AI Agents
Please address the comments from this code review:

## Overall Comments
- app/cli/comet-banner.ts has grown quite large and mixes pure rendering, animation timing, and I/O concerns; consider splitting it into a pure rendering module and a small runtime/IO adapter so the animation logic is easier to follow and maintain.
- The BannerRuntime/getColumns/readColumns/animationFrameForRuntime chain is fairly indirect and throws on width changes; you could simplify by reading columns once per frame and passing the width into the renderer, turning width changes into a graceful static fallback instead of an exception path.
- renderCometBannerFrame now just wraps renderCometAnimationFrame('sweep', …) and is only used in tests; if there is no external dependency on it, consider making this an internal helper or inlining it to keep the public API surface of comet-banner.ts smaller.

Sourcery is free for open source - if you like our reviews please consider sharing them ✨
Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Actionable comments posted: 3

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@app/cli/comet-banner.ts`:
- Around line 237-245: Update animationFrameForRuntime to center each banner
frame using the current terminal column count when the runtime supports a
sufficiently wide TTY, including after resize events. Preserve unindented frames
for narrow terminals and non-TTY/static fallback paths, and ensure
staticFrameForRuntime remains compatible without runtime input.

In `@CHANGELOG.md`:
- Line 16: Update the release entry in CHANGELOG.md to include the required ###
Added, ### Changed, ### Fixed, ### Tests, ### Removed, and ### Security
headings, preserving the existing release content and leaving Tests empty rather
than listing ordinary regression tests.

In `@docs/superpowers/specs/2026-07-12-cli-banner-animation-design.md`:
- Line 22: Update the “扩散与落版(1100–1800ms)” design requirement to specify the
tagline’s actual gold final color, or update the banner implementation to render
the documented bright cyan-blue; ensure the requirement and implementation agree
unambiguously.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 288c16a3-2aa3-4697-85a2-577b2831423f

📥 Commits

Reviewing files that changed from the base of the PR and between e29c46a and 62b9e28.

📒 Files selected for processing (11)
  • CHANGELOG.md
  • app/cli/comet-banner.ts
  • app/cli/index.ts
  • app/commands/init.ts
  • docs/superpowers/plans/2026-07-12-cli-banner-animation.md
  • docs/superpowers/specs/2026-07-12-cli-banner-animation-design.md
  • package.json
  • test/app/cli-help.test.ts
  • test/app/comet-banner.test.ts
  • test/app/init-e2e.test.ts
  • website

Comment thread app/cli/comet-banner.ts
Comment thread CHANGELOG.md
Comment thread docs/superpowers/specs/2026-07-12-cli-banner-animation-design.md Outdated
Comment thread app/cli/comet-banner.ts

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
docs/superpowers/specs/2026-07-12-cli-banner-animation-design.md (1)

34-34: 🎯 Functional Correctness | 🟠 Major | 🏗️ Heavy lift

Implement terminal-relative centering, or revise this specification.

The current implementation renders onto a fixed BANNER_WIDTH canvas, while animationFrameForRuntime() only validates the terminal width and returns the frame unchanged. It therefore does not recalculate left padding per frame, so output remains internally centered and terminal-width changes cannot update alignment. This also conflicts with the planned 80/100/120-column and resize tests in Lines 63–65.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@docs/superpowers/specs/2026-07-12-cli-banner-animation-design.md` at line 34,
Revise the banner rendering flow around animationFrameForRuntime() to apply
terminal-relative centering on every frame: calculate left padding from the
current terminal column count and frame width, then prepend the same indentation
to every Logo, particle, and tagline line, including the final static frame.
Ensure terminal resizes recalculate alignment on the next frame, or update this
specification to match the fixed BANNER_WIDTH behavior and remove the
conflicting resize and width-test requirements.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Outside diff comments:
In `@docs/superpowers/specs/2026-07-12-cli-banner-animation-design.md`:
- Line 34: Revise the banner rendering flow around animationFrameForRuntime() to
apply terminal-relative centering on every frame: calculate left padding from
the current terminal column count and frame width, then prepend the same
indentation to every Logo, particle, and tagline line, including the final
static frame. Ensure terminal resizes recalculate alignment on the next frame,
or update this specification to match the fixed BANNER_WIDTH behavior and remove
the conflicting resize and width-test requirements.

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: bc1cfa4a-3006-45ba-9671-5c891f5935f5

📥 Commits

Reviewing files that changed from the base of the PR and between 62b9e28 and 9d2d978.

📒 Files selected for processing (1)
  • docs/superpowers/specs/2026-07-12-cli-banner-animation-design.md

@benym benym merged commit 8f67004 into master Jul 12, 2026
15 checks passed
@benym benym deleted the optimize_cli branch July 12, 2026 13:01
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