The runner configuration (templates, logger, cwd, prompter).
The run result: success flag, elapsed time and per-operation actions.
Programmatic entry point of the generator. Resolves the config
(templates directory and .hygen.js), runs the engine pipeline and normalises
the outcome into a RunnerResult. A ShowHelpError is routed to printHelp.
import { runner, Logger } from '@biorate/hygen';
const result = await runner(['app', 'new', '--name', 'myapp'], {
cwd: process.cwd(),
templates: '_templates',
logger: new Logger((msg) => console.log(msg)),
exec: (sh, body) => {},
createPrompter: () => require('enquirer'),
});
console.log(result.success); // true
The CLI-style arguments (e.g.
['init', 'self']).