UNPKG

@dscodotco/theme-cli

Version:

A CLI tool for developing Shopify themes

41 lines (40 loc) 1.18 kB
/** * @module cli * @description Main CLI functionality for configuring and running commands */ import { Command } from "commander"; /** * Creates and configures the root CLI command * * Sets up the main program with all available commands and global options. * Currently supports Shopify commands, with a structure that allows easy * addition of commands for other e-commerce platforms. * * @returns The configured Command object ready to be run * * @example * ```typescript * const program = createCli(); * program.parse(process.argv); * ``` */ export declare function createCli(): Command; /** * Runs the CLI with the given arguments * * Parses the arguments and executes the appropriate command. * Handles any errors that might occur during command execution. * * @param args - Command line arguments (defaults to process.argv) * @returns A promise that resolves when the command completes * * @example * ```typescript * // Run with default arguments * await runCli(); * * // Run with custom arguments * await runCli(['node', 'script.js', 'shopify', 'theme', 'init']); * ``` */ export declare function runCli(args?: string[]): Promise<void>;