diff --git a/.changeset/tall-suns-vanish.md b/.changeset/tall-suns-vanish.md new file mode 100644 index 0000000..1d22564 --- /dev/null +++ b/.changeset/tall-suns-vanish.md @@ -0,0 +1,5 @@ +--- +"@bunny.net/cli": patch +--- + +Added bunny color to the table head and also the help overview. diff --git a/packages/cli/src/core/define-namespace.ts b/packages/cli/src/core/define-namespace.ts index ccf9c1a..e7ba2b1 100644 --- a/packages/cli/src/core/define-namespace.ts +++ b/packages/cli/src/core/define-namespace.ts @@ -1,5 +1,5 @@ import type { Argv, CommandModule } from "yargs"; - +import { bunny } from "./colors.ts"; /** * Groups subcommands under a parent namespace. Running the namespace * without a subcommand shows help. @@ -32,8 +32,16 @@ export function defineNamespace( for (const sub of subcommands) yargs.command(sub); return yargs; }, - handler: () => { - yRef.showHelp("log"); + handler: async () => { + try { + const helpText = await yRef.getHelp(); + const colored = helpText + .replace(/^Commands:/m, bunny.bold("Commands:")) + .replace(/^Options:/m, bunny.bold("Options:")); + console.log(colored); + } catch (err) { + console.error("Failed to load help text:", err); + } }, }; } diff --git a/packages/cli/src/core/format.ts b/packages/cli/src/core/format.ts index 74b18a4..c1bf78e 100644 --- a/packages/cli/src/core/format.ts +++ b/packages/cli/src/core/format.ts @@ -1,5 +1,6 @@ import chalk from "chalk"; import Table from "cli-table3"; +import { bunny } from "./colors.ts"; import type { OutputFormat } from "./types.ts"; /** Resolve a date-like value to a `Date`, or `null` if invalid/missing. */ @@ -95,7 +96,7 @@ export function formatTable( // text: borderless aligned columns with bold headers const table = new Table({ - head: headers.map((h) => chalk.bold(h)), + head: headers.map((h) => bunny.bold(h)), chars: { top: "", "top-mid": "",