Skip to main content

ScaffoldInput

Defined in: types.ts:266

Defines a single interactive input for a scaffold template.

Example

inputs: {
author: { message: "Author name", required: true },
license: { type: "select", message: "License", options: ["MIT", "Apache-2.0", "GPL-3.0"] },
private: { type: "confirm", message: "Private package?", default: false },
port: { type: "number", message: "Dev server port", default: 3000 },
}

Properties

type?

optional type?: ScaffoldInputType

Defined in: types.ts:268

The type of prompt. Defaults to "text".


message?

optional message?: string

Defined in: types.ts:270

The prompt message shown to the user. Defaults to the input key name if omitted.


required?

optional required?: boolean

Defined in: types.ts:272

Whether this input must be provided. If true and missing, the user will be prompted interactively.


default?

optional default?: string | number | boolean

Defined in: types.ts:274

Default value. Type depends on the input type: string for text/select, boolean for confirm, number for number.


options?

optional options?: (string | { name: string; value: string; })[]

Defined in: types.ts:276

List of options for type: "select". Each can be a string or { name, value }.