interface CliDependencies

Everything the CLI reaches the outside world through.

There is deliberately no default: the process-level values (Deno.cwd(), console.log, the Deno filesystem) belong to src/main.ts, the one module that owns the process boundary. A defaulted fs here would let a misconfigured call silently degrade to "no filesystem" at runtime.

Properties

readonly
fs: IFileSystem

The filesystem all reads and writes go through.

readonly
cwd: string

The working directory commands resolve relative paths against (absolute).

readonly
now: () => number

Wall-clock milliseconds, for timestamped output.

readonly
log: (message: string) => void

Writes a line of normal output.

readonly
error: (message: string) => void

Writes a line of error output.

readonly
optional
load: ModuleLoader

Loads a custom schematic module; defaults to a real dynamic import().

readonly
optional
loadApp: AppLoader

Loads the target project's setu.config.ts; defaults to a real dynamic import(). Only the plugin-command paths use it.

readonly
optional
portAvailable: PortProbe

Checks whether a workspace port can bind before the CLI assigns it.

readonly
optional
ask: Prompter

Asks the questions setu new already accepts as flags.

OPTIONAL by construction: when absent — as in every gate, which reaches the CLI through an in-process runCli — no prompt is ever attempted and each absent flag takes its documented default. src/main.ts supplies the terminal implementation only behind Deno.stdin.isTerminal().

Usage

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