PromptEngine
Prompt engine interface.
Implementations present one prompt per promptOne() call and return the result. Engines may retain state across calls, such as an answer queue.
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:
src/core/prompt/index.ts:102
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 };
}
};