#!/usr/bin/env node
import { Command } from "commander";

import { version } from "../package.json";
import { add } from "./commands/add";
import { block } from "./commands/block";
import { init } from "./commands/init";
import { list } from "./commands/list";
import { addPrettier } from "./commands/prettier";
import { prose } from "./commands/prose";
import { remove } from "./commands/remove";
import { addShortcuts } from "./commands/shortcuts";
import { theme } from "./commands/theme";
import { update } from "./commands/update";
import { printFancyBoxMessage } from "./utils/printFancyBoxMessage";

process.on("SIGINT", () => process.exit(0));
process.on("SIGTERM", () => process.exit(0));
process.on("SIGTSTP", () => process.exit(0));

const program = new Command();

console.clear();

printFancyBoxMessage("UI Thing", undefined, { box: { title: "Welcome" } });
console.log();

program
  .name("ui-thing")
  .description("CLI for adding ui-thing components to your Nuxt application")
  .version(version)
  .addCommand(init)
  .addCommand(add)
  .addCommand(prose)
  .addCommand(block)
  .addCommand(theme)
  .addCommand(list)
  .addCommand(update)
  .addCommand(remove)
  .addCommand(addShortcuts)
  .addCommand(addPrettier);

program.parse(process.argv);
