interface GeneratedFile

One file a schematic asks the command layer to create.

Properties

readonly
path: string

Path to write, relative to the command's target directory.

readonly
contents: string

The file contents.

readonly
optional
managed: boolean

Marks a file the CLI owns outright and regenerates, exempting it from the overwrite refusal in findExisting.

Set on exactly one emitted file today: the src/modules/index.ts aggregate barrel, which has to list every module and therefore has to be rewritten whenever one is added. Every other path keeps the refusal.

Declared per FILE rather than as a --force flag on the command, deliberately: a flag would lift the check for all fourteen schematics, so a mistyped setu g service user could clobber hand-written work. A schematic naming the files it owns keeps the exemption to paths the CLI wrote in the first place, and findExisting is the single chokepoint every write passes through, so it cannot be bypassed elsewhere.

Omitted or false → current behavior, byte-identical.

Usage

import { type GeneratedFile } from "cli/src/index.ts";