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, }, })