From 758ebd8cd22c9437a46ed976055af543ddd40540 Mon Sep 17 00:00:00 2001 From: Claude Date: Sat, 18 Jul 2026 18:08:28 +0000 Subject: [PATCH] feat: add help command to list all available commands Registers an explicit `help` subcommand alongside the existing --help flag so `chaibuilder-app help` also prints the full command list. --- src/index.ts | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/src/index.ts b/src/index.ts index 8bfd8ba..8679b10 100644 --- a/src/index.ts +++ b/src/index.ts @@ -1,11 +1,21 @@ import { createRequire } from 'node:module' -import { defineCommand, runMain } from 'citty' +import { defineCommand, runMain, showUsage } from 'citty' import { checkEnvCommand } from './commands/check-env.js' import { createAppCommand } from './commands/create-app.js' const require = createRequire(import.meta.url) const pkg = require('../package.json') +const helpCommand = defineCommand({ + meta: { + name: 'help', + description: 'Show all available commands', + }, + async run() { + await showUsage(main) + }, +}) + const main = defineCommand({ meta: { name: 'chaibuilder-app', @@ -15,6 +25,7 @@ const main = defineCommand({ subCommands: { create: createAppCommand, 'check-env': checkEnvCommand, + help: helpCommand, }, })