import { InitStructure } from "./outfitter-e5x0ybqt.js"; import { InitPresetId } from "./outfitter-11r5ny73.js"; import { PostScaffoldResult } from "./outfitter-hcexcvxe.js"; import { OutputMode } from "@outfitter/cli/types"; import { Result } from "@outfitter/contracts"; import { AddBlockResult } from "@outfitter/tooling"; import { Command } from "commander"; /** * Options for the init command, corresponding to CLI flags and positional arguments. */ interface InitOptions { /** Custom binary name for CLI/daemon presets. */ readonly bin?: string | undefined; /** Preview changes without writing to disk. */ readonly dryRun?: boolean | undefined; /** Example name to overlay pattern-rich scaffold files (e.g., "todo" for cli, "files" for mcp). */ readonly example?: string | undefined; /** Overwrite existing files without prompting. */ readonly force: boolean; /** Timeout in milliseconds for `bun install`. */ readonly installTimeout?: number | undefined; /** Use `workspace:*` protocol for `@outfitter` dependencies. */ readonly local?: boolean | undefined; /** Package name override (defaults to directory name). */ readonly name: string | undefined; /** Skip adding default tooling blocks. */ readonly noTooling?: boolean | undefined; /** Preset to scaffold from. */ readonly preset?: InitPresetId | undefined; /** Skip the initial git commit after scaffolding. */ readonly skipCommit?: boolean | undefined; /** Skip git init and initial commit entirely. */ readonly skipGit?: boolean | undefined; /** Skip running `bun install` after scaffolding. */ readonly skipInstall?: boolean | undefined; /** Whether to create a single package or a workspace. */ readonly structure?: InitStructure | undefined; /** Absolute or relative path to the target directory. */ readonly targetDir: string; /** Comma-separated tooling block names to include. */ readonly with?: string | undefined; /** Package name for the workspace root (workspace structure only). */ readonly workspaceName?: string | undefined; /** Skip interactive prompts and use defaults. */ readonly yes?: boolean | undefined; } /** * Result of a successful `outfitter init` run. */ interface InitResult { /** Tooling blocks that were added, if any. */ readonly blocksAdded?: AddBlockResult | undefined; /** Present only for dry-run invocations; contains the planned operations and summary counts. */ readonly dryRunPlan?: { readonly operations: readonly unknown[]; readonly summary: Record; } | undefined; /** The resolved npm package name for the scaffolded project. */ readonly packageName: string; /** Results from post-scaffold steps (install, git init, next-step hints). */ readonly postScaffold: PostScaffoldResult; /** The preset that was used. */ readonly preset: InitPresetId; /** Absolute path to the scaffolded project directory. */ readonly projectDir: string; /** Absolute path to the workspace or project root. */ readonly rootDir: string; /** Whether a single package or workspace was created. */ readonly structure: InitStructure; } /** * Error returned when initialization fails. */ declare class InitError extends Error { readonly _tag: "InitError"; /** @param message - Human-readable description of the init failure. */ constructor(message: string); } /** * Runs the full init flow: resolves user input (interactive or non-interactive), * looks up the target preset, and delegates to the execution pipeline. * @param options - Init options from CLI flags or programmatic callers * @param presetOverride - Forces a specific preset, bypassing flag resolution and prompts */ declare function runInit(options: InitOptions, presetOverride?: InitPresetId): Promise>; /** * Registers the `init` command and its preset subcommands on a Commander program. * @deprecated Use action-registry CLI wiring via `buildCliCommands(outfitterActions, ...)`. */ declare function initCommand(program: Command): void; /** Options controlling how init results are rendered (human-readable, JSON, or JSONL). */ interface PrintInitResultsOptions { readonly mode?: OutputMode; } /** * Renders init results to stdout. Handles dry-run plans, structured output modes, * and human-readable summaries with next-step guidance. */ declare function printInitResults(result: InitResult, options?: PrintInitResultsOptions): Promise; export { PrintInitResultsOptions, printInitResults, InitOptions, InitResult, InitError, runInit, initCommand };