Skip to content

marmotte / cli/create

cli/create

Type Aliases

CreateOptions

CreateOptions = object

Defined in: src/cli/create.ts:12

Options for runCreate. All fields are optional; missing ones are prompted interactively.

Properties

dir?

optional dir: string

Defined in: src/cli/create.ts:14

Target directory to scaffold into. Defaults to ./my-project when prompted.

examples?

optional examples: boolean

Defined in: src/cli/create.ts:32

Whether to include example source files. Defaults to true; pass false to skip. Only applies when template is a built-in. Has no effect for custom templates.

features?

optional features: string[]

Defined in: src/cli/create.ts:34

Feature IDs to apply (e.g. ["lint", "format"]). When provided, skips the feature prompt.

name?

optional name: string

Defined in: src/cli/create.ts:27

Project name written into package.json. Defaults to the target directory basename when prompted.

template?

optional template: string

Defined in: src/cli/create.ts:25

Template ID or remote source. When provided, skips the template prompt and enables non-interactive mode (features and examples are not prompted).

Accepted values:

  • Built-in ID: "node-library", "ui-library", "ui-app"
  • GitHub shorthand: "user/repo"
  • giget source: "github:user/repo", "gitlab:user/repo", "https://…"
  • Local path: "./path/to/template"

Functions

runCreate()

runCreate(opts?): Promise<void>

Defined in: src/cli/create.ts:52

Scaffold a new project from a template.

Prompts are shown for any value not supplied in opts. Supplying template enables fully non-interactive mode — examples and features also stop prompting.

Parameters

opts?

CreateOptions = {}

Returns

Promise<void>

Examples

ts
await runCreate(); // prompts for everything
ts
await runCreate({ dir: "./my-lib", template: "node-library", name: "my-lib", examples: false });