cli.ts 1.1 KB

123456789101112131415161718192021222324252627282930313233
  1. #! /usr/bin/env node
  2. import { Command } from 'commander';
  3. import pc from 'picocolors';
  4. import { cliCommands } from './commands/command-declarations';
  5. import { registerCommands } from './shared/command-registry';
  6. const program = new Command();
  7. // eslint-disable-next-line @typescript-eslint/no-var-requires
  8. const version = require('../package.json').version;
  9. program
  10. .version(version)
  11. .usage(`vendure <command>`)
  12. .description(
  13. pc.blue(`
  14. 888
  15. 888
  16. 888
  17. 888 888 .d88b. 88888b. .d88888 888 888 888d888 .d88b.
  18. 888 888 d8P Y8b 888 "88b d88" 888 888 888 888P" d8P Y8b
  19. Y88 88P 88888888 888 888 888 888 888 888 888 88888888
  20. Y8bd8P Y8b. 888 888 Y88b 888 Y88b 888 888 Y8b.
  21. Y88P "Y8888 888 888 "Y88888 "Y88888 888 "Y8888
  22. `),
  23. );
  24. // Register all commands from the array
  25. registerCommands(program, cliCommands);
  26. void program.parseAsync(process.argv);