import { create } from "./create"; import { generate } from "./generate"; const commands = { create: { description: "Generates the example site into the specified directory", execute: create }, generate: { description: "Produces the ready-to-deploy version of the site", execute: generate } }; export function cli() { const command = commands[process.argv[2] as keyof typeof commands]; if (!command) { console.log(); console.log("Zapata supports these commands:"); console.log(); for (const c of Object.entries(commands)) { console.log(` ${c[0].padEnd(14)} ${c[1].description}`); console.log(); } } else { command.execute(process.argv.slice(3)); } }