PromptEngine
Prompt engine interface.
Implementations render a single prompt to the user and return the result. The engine is stateless per call — each promptOne is independent.
The resolution chain calls promptOne for each flag that needs interactive input. Engines do not need schema knowledge — all relevant context (message, choices, validation) is in the config.
- Import:
@kjanat/dreamcli - Export kind: interface
- Declared in:
src/core/prompt/index.ts - Source link:
packages/dreamcli/src/core/prompt/index.ts:103
Signatures
ts
interface PromptEngine {}Members
Methods
promptOne
ts
promptOne(config: ResolvedPromptConfig): Promise<PromptResult>;Examples
ts
// Custom engine (e.g. wrapping @clack/prompts)
const engine: PromptEngine = {
async promptOne(config) {
// ... render with your library
return { answered: true, value: userInput };
}
};