Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions apps/cli/src/__tests__/startup-graph.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -155,6 +155,17 @@ describe("bb startup module graph", () => {
}
}, 30_000);

it("marks mandatory flags in help without marking optional flags", async () => {
const spawn = await runCli("source", ["thread", "spawn", "--help"]);
expect(spawn.stdout).toMatch(/--project\b[^\n]*\(required\)/);
expect(spawn.stdout).toMatch(/--prompt\b[^\n]*\(required\)/);
expect(spawn.stdout).not.toMatch(/--provider[^\n]*\(required\)/);

const list = await runCli("source", ["thread", "list", "--help"]);
expect(list.stdout).toMatch(/--project\b/);
expect(list.stdout).not.toMatch(/--project\b[^\n]*\(required\)/);
}, 30_000);

it("shows and enforces the thread search result limit", async () => {
const help = await runCli(
"source",
Expand Down
8 changes: 7 additions & 1 deletion apps/cli/src/index.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#!/usr/bin/env node
import { Command } from "commander";
import { Command, Help } from "commander";
import { maybeReexecViaBbCli } from "./bb-cli-reexec.js";
import {
CORE_COMMAND_GROUPS,
Expand All @@ -17,6 +17,12 @@ const program = new Command();
program
.name("bb")
.description("BB CLI - manage your AI coding agents")
.configureHelp({
optionDescription(option) {
const description = Help.prototype.optionDescription.call(this, option);
return option.mandatory ? `(required) ${description}` : description;
},
})
.enablePositionalOptions()
.version(resolveBbCliVersion());

Expand Down