Skip to content

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.

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 };
  }
};

See Also

Released under the MIT License.