Skip to content

Commit 4bb3279

Browse files
vanceingallsclaude
andcommitted
fix(cli): improve --help documentation and add --yes/--check to upgrade
- upgrade: add --yes and --check flags to skip interactive prompt - benchmark: clarify description — preset fps/quality/worker configs - browser: describe each subcommand (ensure/path/clear) in help - docs: list available topics inline in --help output Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent 9c603c9 commit 4bb3279

4 files changed

Lines changed: 30 additions & 11 deletions

File tree

packages/cli/src/commands/benchmark.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ const DEFAULT_CONFIGS: BenchmarkConfig[] = [
3838
export default defineCommand({
3939
meta: {
4040
name: "benchmark",
41-
description: "Run multiple render configurations and compare results",
41+
description: "Render with preset fps/quality/worker configs and compare speed and file size",
4242
},
4343
args: {
4444
dir: { type: "positional", description: "Project directory", required: false },

packages/cli/src/commands/browser.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,8 @@ export default defineCommand({
9090
args: {
9191
subcommand: {
9292
type: "positional",
93-
description: "Subcommand: ensure, path, clear",
93+
description:
94+
"ensure = find or download Chrome, path = print executable path, clear = remove cached download",
9495
required: false,
9596
},
9697
},

packages/cli/src/commands/docs.ts

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,10 +84,16 @@ function renderMarkdown(content: string): void {
8484
}
8585
}
8686

87+
const TOPIC_NAMES = Object.keys(TOPICS).join(", ");
88+
8789
export default defineCommand({
8890
meta: { name: "docs", description: "View inline documentation in the terminal" },
8991
args: {
90-
topic: { type: "positional", description: "Topic to view", required: false },
92+
topic: {
93+
type: "positional",
94+
description: `Topic: ${TOPIC_NAMES}. Omit to list all.`,
95+
required: false,
96+
},
9197
},
9298
async run({ args }) {
9399
const topic = args.topic;

packages/cli/src/commands/upgrade.ts

Lines changed: 20 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,13 @@ import { VERSION } from "../version.js";
55

66
export default defineCommand({
77
meta: { name: "upgrade", description: "Check for updates and show upgrade instructions" },
8-
args: {},
9-
async run() {
8+
args: {
9+
yes: { type: "boolean", alias: "y", description: "Show upgrade commands without prompting" },
10+
check: { type: "boolean", description: "Check for updates and exit (no prompt)" },
11+
},
12+
async run({ args }) {
13+
const autoYes = args.yes === true;
14+
const checkOnly = args.check === true;
1015
clack.intro(c.bold("hyperframes upgrade"));
1116

1217
const s = clack.spinner();
@@ -41,15 +46,22 @@ export default defineCommand({
4146
console.log(` ${c.dim("Latest:")} ${c.bold(c.accent("v" + latest))}`);
4247
console.log();
4348

44-
const shouldUpgrade = await clack.confirm({
45-
message: "Upgrade now?",
46-
});
47-
48-
if (clack.isCancel(shouldUpgrade) || !shouldUpgrade) {
49-
clack.outro(c.dim("Skipped."));
49+
if (checkOnly) {
50+
clack.outro(c.accent("Update available: v" + latest));
5051
return;
5152
}
5253

54+
if (!autoYes) {
55+
const shouldUpgrade = await clack.confirm({
56+
message: "Upgrade now?",
57+
});
58+
59+
if (clack.isCancel(shouldUpgrade) || !shouldUpgrade) {
60+
clack.outro(c.dim("Skipped."));
61+
return;
62+
}
63+
}
64+
5365
console.log();
5466
console.log(` ${c.accent("npm install -g hyperframes@" + latest)}`);
5567
console.log(` ${c.dim("or")}`);

0 commit comments

Comments
 (0)