import { Command, CompletionsCommand } from "./deps/cliffy.ts"; import { getCurrentVersion } from "./core/utils/lume_version.ts"; const upgrade = new Command() .description("Upgrade your Lume executable to the latest version.") .option( "--version ", "The version to upgrade to.", ) .option( "-d, --dev", "Install the latest development version (last Git commit).", ) .example("lume upgrade -g", "Upgrades to the latest stable version.") .example("lume upgrade --dev", "Upgrades to the latest development version.") .action(async ({ dev, version }) => { const { default: upgrade } = await import("./cli/upgrade.ts"); await upgrade(dev, version); }); const create = new Command() .description("Run an archetype to create more files.") .example( "lume new post 'Post title'", "Create a new post file using the _archetypes/post.ts archetype.", ) // @ts-ignore: todo: fix this .action(async ({ config }, name, ...args) => { const { create } = await import("./cli/create.ts"); await create(config, name, args); }); const lume = new Command() .name("🔥lume") .version(() => getCurrentVersion()) .description( "A static site generator for Deno. \nDocs: https://lume.land", ) .example("lume", "Builds the site.") .example("lume --serve", "Serves the site in localhost.") .example("lume upgrade", "Upgrades Lume to the latest version.") .example("lume run