perf(cli): speed up startup

This commit is contained in:
Peter Steinberger
2026-02-14 12:16:16 +00:00
parent a7a08b6650
commit c90b3e4d5e
8 changed files with 223 additions and 44 deletions

View File

@@ -3,12 +3,14 @@ import { registerProgramCommands } from "./command-registry.js";
import { createProgramContext } from "./context.js";
import { configureProgramHelp } from "./help.js";
import { registerPreActionHooks } from "./preaction.js";
import { setProgramContext } from "./program-context.js";
export function buildProgram() {
const program = new Command();
const ctx = createProgramContext();
const argv = process.argv;
setProgramContext(program, ctx);
configureProgramHelp(program, ctx);
registerPreActionHooks(program, ctx.programVersion);