UNPKG

@hammerhq/cli-tool

Version:

✨ A simple CLI commander system

29 lines (26 loc) 759 B
import { IHargsOptionDefinition, IHargsParseResult } from '@hammerhq/hargs'; interface ICommand { name: string; usage: string; example: string[]; category: string; aliases: string[]; description: string; argDefinitions: IHargsOptionDefinition; } interface UnknownObject { [key: string]: unknown; } interface HelpCategory { [key: string]: ICommand[]; } type ToolFunction = (command: string, args: IHargsParseResult) => unknown; declare class Tool { private commands; private commandExecuted; private handleHelp; createCommand(command: ICommand, fn: ToolFunction): Tool; help(): void; } declare const tool: Tool; export { type HelpCategory, type ICommand, type ToolFunction, type UnknownObject, tool };