Skip to content

Add bunny colors to table header and command overview#102

Merged
jamie-at-bunny merged 4 commits into
BunnyWay:mainfrom
nocanoa:style-bunny-colors
Jun 25, 2026
Merged

Add bunny colors to table header and command overview#102
jamie-at-bunny merged 4 commits into
BunnyWay:mainfrom
nocanoa:style-bunny-colors

Conversation

@nocanoa

@nocanoa nocanoa commented Jun 24, 2026

Copy link
Copy Markdown
Contributor

No description provided.

@bogdan-at-bunny

Copy link
Copy Markdown

@codex review

@changeset-bot

changeset-bot Bot commented Jun 24, 2026

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: 5c3ac81

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 6 packages
Name Type
@bunny.net/cli Patch
@bunny.net/cli-linux-x64 Patch
@bunny.net/cli-linux-arm64 Patch
@bunny.net/cli-darwin-x64 Patch
@bunny.net/cli-darwin-arm64 Patch
@bunny.net/cli-windows-x64 Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@greptile-apps

greptile-apps Bot commented Jun 24, 2026

Copy link
Copy Markdown

Greptile Summary

This PR applies the brand orange color (bunny) to terminal output: table headers in the "text" format and section-heading labels (Commands:, Options:) in namespace help text.

  • format.ts: Replaces chalk.bold(h) with bunny.bold(h) for "text"-format table headers; NO_COLOR handling is preserved because chalk.level === 0 causes chalk to emit plain strings and noColorStyle still suppresses cli-table3's own header styling.
  • define-namespace.ts: Switches from showHelp("log") to getHelp().then(...) so the help string can be regex-transformed before printing; the previously flagged missing return in the handler is still present.
  • .changeset/tall-suns-vanish.md: Patch changeset added.

Confidence Score: 5/5

Safe to merge — changes are purely cosmetic terminal styling with no logic or data-path impact.

Both changed code paths affect only terminal color rendering. The format.ts change is a straightforward chalk style swap, and the NO_COLOR guard remains intact. The define-namespace.ts handler change builds on top of the async issue flagged in a previous review cycle; that pre-existing concern aside, the regex replacement logic itself is correct and benign.

No files require special attention beyond the previously reviewed handler in define-namespace.ts.

Important Files Changed

Filename Overview
packages/cli/src/core/format.ts Swaps chalk.bold for bunny.bold on "text" format table headers; NO_COLOR path is unaffected because chalk.level === 0 causes chalk to return plain strings.
packages/cli/src/core/define-namespace.ts Replaces showHelp with getHelp().then(...) to colorise "Commands:" and "Options:" section headers; the Promise is still not returned from the handler (previously flagged).
.changeset/tall-suns-vanish.md Adds a patch-level changeset entry for the new header coloring.

Flowchart

%%{init: {'theme': 'neutral'}}%%
flowchart TD
    A["User runs namespace command"] --> B["handler called"]
    B --> C["yRef.getHelp()"]
    C --> D["helpText string"]
    D --> E["replace Commands: with bunny.bold"]
    E --> F["replace Options: with bunny.bold"]
    F --> G["console.log colored output"]

    H["formatTable - format=text"] --> I["headers mapped with bunny.bold"]
    I --> J{"chalk.level === 0?"}
    J -- Yes --> K["plain text headers, head style suppressed"]
    J -- No --> L["orange bold headers rendered"]
Loading
%%{init: {'theme': 'base', 'themeVariables': {"darkMode": true, "background": "#0d1117", "primaryColor": "#21262d", "primaryTextColor": "#e6edf3", "primaryBorderColor": "#8b949e", "lineColor": "#8b949e", "textColor": "#e6edf3", "edgeLabelBackground": "#161b22", "actorBkg": "#21262d", "actorBorder": "#8b949e", "actorTextColor": "#e6edf3", "actorLineColor": "#8b949e", "signalColor": "#8b949e", "signalTextColor": "#e6edf3", "noteBkgColor": "#373320", "noteBorderColor": "#d4a72c", "noteTextColor": "#f0e6c0", "labelBoxBkgColor": "#21262d", "labelBoxBorderColor": "#8b949e", "labelTextColor": "#e6edf3", "loopTextColor": "#e6edf3", "activationBkgColor": "#30363d", "activationBorderColor": "#8b949e"}}}%%
flowchart TD
    A["User runs namespace command"] --> B["handler called"]
    B --> C["yRef.getHelp()"]
    C --> D["helpText string"]
    D --> E["replace Commands: with bunny.bold"]
    E --> F["replace Options: with bunny.bold"]
    F --> G["console.log colored output"]

    H["formatTable - format=text"] --> I["headers mapped with bunny.bold"]
    I --> J{"chalk.level === 0?"}
    J -- Yes --> K["plain text headers, head style suppressed"]
    J -- No --> L["orange bold headers rendered"]
Loading

Reviews (2): Last reviewed commit: "fix order import order" | Re-trigger Greptile

Comment on lines 35 to 42
handler: () => {
yRef.showHelp("log");
yRef.getHelp().then((helpText) => {
const colored = helpText
.replace(/^Commands:/m, bunny.bold("Commands:"))
.replace(/^Options:/m, bunny.bold("Options:"));
console.log(colored);
});
},

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P1 Promise not returned from yargs handler

The Promise returned by getHelp().then(...) is discarded — the handler returns void instead of Promise<void>. Yargs awaits a handler's returned Promise to know when async work is done; when the return value is dropped, the process can drain the event loop and exit before console.log fires, silently printing nothing. The fix is to add return before yRef.getHelp(), and add a .catch() (or convert to async/await) to surface any errors instead of producing an unhandled rejection.

Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time!

Fix in Claude Code

@@ -1,5 +1,5 @@
import type { Argv, CommandModule } from "yargs";

import { bunny } from "../core/colors.ts";

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Roundabout self-referential import path

Both define-namespace.ts and format.ts (line 4) import colors.ts via "../core/colors.ts" — going up from core/ to src/ and back into core/. Since all three files live in the same packages/cli/src/core/ directory, the canonical import is "./colors.ts".

Fix in Claude Code

@jamie-at-bunny jamie-at-bunny 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.

Thanks @nocanoa 🚀

@jamie-at-bunny jamie-at-bunny merged commit b4c1bd9 into BunnyWay:main Jun 25, 2026
1 check passed
@github-actions github-actions Bot mentioned this pull request Jun 25, 2026
@nocanoa nocanoa deleted the style-bunny-colors branch June 25, 2026 11:59
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.

3 participants