/** * @license * Copyright 2026 Steven Roussey * SPDX-License-Identifier: Apache-2.0 */ import type { Command } from "commander"; import type { RegisterWebCommandOptions } from "./commands/web"; export interface WorkglowCliOptions { /** Program name, version and description shown in `--help`. */ readonly name?: string; readonly version?: string; readonly description?: string; /** * Register additional task types before the commands are wired. * * `task list` and `task run` enumerate the global {@link TaskRegistry}, so a * downstream CLI contributes its own tasks by registering them here — the * commands need no per-package knowledge, and the web console picks them up * from the same program. */ readonly registerTasks?: () => void | Promise; /** Add commands of your own, after the built-in ones are registered. */ readonly registerCommands?: (program: Command) => void | Promise; readonly web?: RegisterWebCommandOptions; /** Commander program to build on. Defaults to commander's shared one. */ readonly program?: Command; readonly argv?: readonly string[]; /** * Exit the process once the command settles (default true). * * The HFT worker and the model repository keep handles open, so a CLI that * merely returns from `parseAsync` hangs at the prompt instead of ending. */ readonly exitOnComplete?: boolean; } /** * Boots the Workglow CLI runtime and runs one command. * * This is the whole of what the `workglow` binary does, exported so a * downstream CLI is a few lines rather than a copy: same task registrations, * same credential store, same model repository, same command set — including * `web` — with hooks to add its own tasks and commands. * * Keeping the body here rather than in a copied entry file is what keeps the * HuggingFace worker resolvable: its URL is relative to this module, so it * resolves inside the installed `@workglow/cli` no matter who called. */ export declare function runWorkglowCli(options?: WorkglowCliOptions): Promise;