PackagesCliReference

cli — Types

Type contracts for the cli package

Type contracts exported by this package: interfaces, type aliases, and enums.

ForgeLoggerOptions

Options for configuring the forge-ts logger at CLI startup.

PropertyTypeRequiredDescription
quietboolean | undefinedNoSuppress all consola output (--quiet flag).
jsonboolean | undefinedNoJSON output mode (--json flag). LAFS handles JSON; suppress consola.
verboseboolean | undefinedNoEnable debug-level output (--verbose flag).

CommandOutput

Typed result from a forge-ts command.

PropertyTypeRequiredDescription
operationstringYesName of the command that produced this output (e.g., "check", "build").
successbooleanYesWhether the command completed successfully.
dataTYesStrongly-typed command-specific result payload.
errorsForgeCliError[] | undefinedNoStructured errors produced by the command, if any.
warningsForgeCliWarning[] | undefinedNoStructured warnings produced by the command, if any.
durationnumber | undefinedNoWall-clock duration of the command in milliseconds.

ForgeCliError

Structured error for CLI commands.

PropertyTypeRequiredDescription
codestringYesMachine-readable error code (e.g., "E004").
messagestringYesHuman-readable error description.
filePathstring | undefinedNoAbsolute path to the source file containing the error, if applicable.
linenumber | undefinedNo1-based line number of the error, if applicable.
columnnumber | undefinedNo0-based column number of the error, if applicable.

ForgeCliWarning

Structured warning for CLI commands.

PropertyTypeRequiredDescription
codestringYesMachine-readable warning code.
messagestringYesHuman-readable warning description.
filePathstring | undefinedNoAbsolute path to the source file containing the warning, if applicable.
linenumber | undefinedNo1-based line number of the warning, if applicable.
columnnumber | undefinedNo0-based column number of the warning, if applicable.

OutputFlags

Output format flags passed through from citty args.

PropertyTypeRequiredDescription
jsonboolean | undefinedNoEmit output as a LAFS JSON envelope instead of human-readable text.
humanboolean | undefinedNoEmit output as formatted human-readable text.
quietboolean | undefinedNoSuppress all output regardless of format.
mvistring | undefinedNoMVI verbosity level: "minimal", "standard", or "full".

AuditArgs

Arguments for the audit command.

PropertyTypeRequiredDescription
cwdstring | undefinedNoProject root directory (default: cwd).
limitnumber | undefinedNoMaximum number of events to display (default: 20).
typeAuditEventType | undefinedNoFilter events by type.

AuditResult

Typed result for the audit command.

PropertyTypeRequiredDescription
successbooleanYesWhether the audit log was read successfully.
countnumberYesNumber of events returned.
eventsAuditEvent[]YesThe audit events, newest first.

BarometerSource

Source provenance for a barometer question.

PropertyTypeRequiredDescription
symbolstringYesSymbol name the fact was extracted from.
filestringYesRelative file path where the symbol is declared.
fieldstringYesWhich field on the symbol yielded the fact (e.g. "signature", "remarks").

BarometerQuestion

A single barometer question with its ground-truth answer.

PropertyTypeRequiredDescription
idstringYesUnique question identifier (e.g. "Q001").
category"signature" | "remarks" | "config" | "architecture" | "rules"YesFact extraction category.
difficulty"easy" | "medium" | "hard"YesDifficulty rating.
questionstringYesThe question text.
answerstringYesGround-truth answer derived from source code.
sourceBarometerSourceYesProvenance information linking back to the source.

BarometerRatingBand

A single rating band in the barometer scoring rubric.

PropertyTypeRequiredDescription
minnumberYesMinimum score (inclusive) for this band.
maxnumberYesMaximum score (inclusive) for this band.
ratingstringYesShort label for this band.
descriptionstringYesDescription of what this band means.

BarometerInstructions

Agent instructions included in --questions-only output.

PropertyTypeRequiredDescription
taskstringYesTask description for the agent.
docsPathstringYesPath to generated documentation the agent should use.
responseFormat{ description: string; example: { answers: Array<{ id: string; answer: string; }>; }; }YesExpected response format.

BarometerResult

Full barometer output written to .forge/barometer.json.

PropertyTypeRequiredDescription
$schemastringYesJSON schema URL.
versionstringYesBarometer format version.
projectstringYesProject name from package.json or config.
generatedstringYesISO 8601 timestamp of when the barometer was generated.
symbolCountnumberYesTotal number of exported symbols analyzed.
questionsBarometerQuestion[]YesGenerated questions with ground-truth answers.
rubric{ scale: BarometerRatingBand[]; scoring: string; }YesScoring rubric for evaluating documentation effectiveness.
instructionsBarometerInstructions | undefinedNoAgent instructions — present only in --questions-only output.

BarometerScoredAnswer

A single scored answer in the barometer score output.

PropertyTypeRequiredDescription
idstringYesQuestion ID.
expectedstringYesExpected answer from the answer key.
gotstringYesAgent's submitted answer.
verdict"correct" | "partial" | "wrong"YesScoring verdict.
categorystringYesQuestion category for aggregate analysis.

BarometerScoreResult

Full barometer score output.

PropertyTypeRequiredDescription
scorenumberYesScore as a percentage (0-100).
ratingstringYesRating band label (e.g. "Elite SSoT").
ratingDescriptionstringYesRating band description.
correctnumberYesNumber of fully correct answers.
partialnumberYesNumber of partially correct answers.
wrongnumberYesNumber of wrong answers.
totalnumberYesTotal questions scored.
missedBarometerScoredAnswer[]YesDetails for every non-correct answer.

BarometerArgs

Arguments for the barometer command.

PropertyTypeRequiredDescription
cwdstring | undefinedNoProject root directory (default: cwd).
questionsOnlyboolean | undefinedNoOutput only questions (no answers) for test agents.
mvistring | undefinedNoMVI verbosity level for structured output.

BuildArgs

Arguments for the build command.

PropertyTypeRequiredDescription
cwdstring | undefinedNoProject root directory (default: cwd).
skipApiboolean | undefinedNoSkip API generation even if enabled in config.
skipGenboolean | undefinedNoSkip doc generation even if enabled in config.
forceStubsboolean | undefinedNoOverwrite stub pages even if they already exist on disk. Normally stub pages (concepts, guides, faq, contributing, changelog) are only created on the first build to preserve manual edits. Use this to reset stubs to their scaffolding state.
mvistring | undefinedNoMVI verbosity level for structured output.

BuildStep

A single step in the build pipeline.

PropertyTypeRequiredDescription
namestringYesInternal step name, e.g. "api" or "gen".
status"success" | "skipped" | "failed"YesOutcome of this step.
outputPathstring | undefinedNoPath to the primary output file produced by this step, if applicable.
durationnumber | undefinedNoWall-clock duration of this step in milliseconds.
errorsForgeCliError[] | undefinedNoErrors produced by this step when status is "failed".

BuildResult

Typed result for the build command.

PropertyTypeRequiredDescription
successbooleanYesWhether the build succeeded.
summary{ steps: number; succeeded: number; failed: number; duration: number; }YesAggregate pipeline counts — always present.
stepsBuildStep[]YesPer-step details.
generatedFilesstring[] | undefinedNoFiles written during the build — present at standard and full MVI levels.

BypassCreateResult

Typed result for the bypass command when creating a bypass.

PropertyTypeRequiredDescription
successbooleanYesWhether the bypass was successfully created.
bypassBypassRecordYesThe bypass record that was created.
remainingBudgetnumberYesNumber of remaining bypass slots for today after creation.
dailyBudgetnumberYesThe configured daily budget.

BypassStatusResult

Typed result for the bypass --status command.

PropertyTypeRequiredDescription
successbooleanYesAlways true for status queries.
activeBypassesBypassRecord[]YesActive (non-expired) bypass records.
remainingBudgetnumberYesNumber of remaining bypass slots for today.
dailyBudgetnumberYesThe configured daily budget.
expiredRemovednumberYesNumber of expired bypasses that were cleaned up.

CheckArgs

Arguments for the check command.

PropertyTypeRequiredDescription
cwdstring | undefinedNoProject root directory (default: cwd).
strictboolean | undefinedNoExit with non-zero code on warnings as well as errors.
verboseboolean | undefinedNoInclude symbol signatures alongside diagnostics.
mvistring | undefinedNoMVI verbosity level for structured output.
rulestring | undefinedNoFilter errors to a specific rule code (e.g., "E001").
filestring | undefinedNoFilter errors to a specific file path (substring match).
stagedboolean | undefinedNoOnly check symbols from git-staged .ts/.tsx files.
limitnumber | undefinedNoMaximum number of file groups to return in byFile (default: 20).
offsetnumber | undefinedNoOffset into the byFile list for pagination (default: 0).

CheckFileError

A single error entry within a file group.

PropertyTypeRequiredDescription
codestringYesMachine-readable error code.
symbolstringYesSymbol name that needs fixing.
kindstringYesSymbol kind (function, class, interface, etc.).
linenumberYes1-based line number of the error.
messagestringYesHuman-readable description.
suggestedFixstring | undefinedNoExact TSDoc block to add (present at full MVI or with --rule/--file filters).
agentActionstring | undefinedNoRecommended agent action.

CheckFileWarning

A single warning entry within a file group.

PropertyTypeRequiredDescription
codestringYesMachine-readable warning code.
symbolstringYesSymbol name that generated the warning.
kindstringYesSymbol kind (function, class, interface, etc.).
linenumberYes1-based line number of the warning.
messagestringYesHuman-readable description.

CheckFileGroup

Errors and warnings grouped by file.

PropertyTypeRequiredDescription
filestringYesAbsolute path to the source file.
errorsCheckFileError[]YesErrors in this file.
warningsCheckFileWarning[]YesWarnings in this file.

CheckRuleCount

Error breakdown by rule code, sorted by count descending.

PropertyTypeRequiredDescription
codestringYesMachine-readable rule code (e.g., "E001").
rulestringYesHuman-readable rule name (e.g., "require-summary").
countnumberYesNumber of violations.
filesnumberYesNumber of unique files affected by this rule.

CheckTriage

Triage data for prioritizing fixes. Always present when the check has errors, bounded in size (~9 rules + top 20 files).

PropertyTypeRequiredDescription
byRuleCheckRuleCount[]YesError counts by rule, sorted descending.
topFiles{ file: string; errors: number; warnings: number; }[]YesTop files by error count (max 20).
fixOrder{ code: string; rule: string; count: number; files: number; }[]YesSuggested fix order: rules sorted by fewest files affected first (quick wins).

CheckPage

Pagination metadata for byFile results.

PropertyTypeRequiredDescription
offsetnumberYesCurrent offset.
limitnumberYesPage size.
hasMorebooleanYesWhether more results exist beyond this page.
totalnumberYesTotal number of file groups (after filters).

CheckResult

Typed result for the check command.

PropertyTypeRequiredDescription
successbooleanYesWhether the check passed without errors.
summary{ errors: number; warnings: number; files: number; symbols: number; duration: number; }YesAggregate counts — always present regardless of MVI level.
triageCheckTriage | undefinedNoTriage data for prioritizing fixes — present when errors 0 (except minimal).
byFileCheckFileGroup[] | undefinedNoPer-file breakdown — present at standard and full MVI levels, paginated.
pageCheckPage | undefinedNoPagination metadata when byFile is paginated.
filters{ rule?: string; file?: string; } | undefinedNoActive filters applied to this result.
nextCommandstring | undefinedNoCLI command hint for the agent to run next.

PkgJson

Parsed package.json with formatting metadata for lossless round-tripping.

PropertyTypeRequiredDescription
pathstringYesAbsolute path to the file.
rawstringYesRaw file content as read from disk.
objRecord<string, unknown>YesParsed JSON object.
indentstringYesDetected indent string (tabs or spaces).
trailingNewlinebooleanYesWhether the original file ended with a newline.

HookManager

Detected hook manager in the project.

HookManager

InitHooksResult

Result of the init hooks command.

PropertyTypeRequiredDescription
successbooleanYesWhether the hook scaffolding succeeded.
hookManagerHookManagerYesThe detected or chosen hook manager.
summary{ filesWritten: number; filesSkipped: number; }YesSummary of what was created.
filesstring[]YesRelative paths of all files written.
instructionsstring[]YesPost-scaffold instructions for the user.

InitHooksArgs

Arguments for the init hooks command.

PropertyTypeRequiredDescription
cwdstring | undefinedNoProject root directory (default: cwd).
forceboolean | undefinedNoForce overwrite existing hook files.
mvistring | undefinedNoMVI verbosity level for structured output.

InitProjectEnvironment

Detected project environment from Step 1 of the init flow.

PropertyTypeRequiredDescription
packageJsonExistsbooleanYesWhether package.json exists.
tsconfigExistsbooleanYesWhether tsconfig.json exists.
biomeDetectedbooleanYesWhether biome.json or biome.jsonc exists.
typescriptVersionstring | nullYesTypeScript version from dependencies, or null if not found.
hookManager"husky" | "lefthook" | "none"YesDetected hook manager.
monorepobooleanYesWhether the project is a monorepo.
monorepoType"pnpm" | "npm/yarn" | nullYesMonorepo type if detected.

InitProjectResult

Result of the init (project setup) command.

PropertyTypeRequiredDescription
successbooleanYesWhether the init succeeded.
createdstring[]YesFiles that were created.
skippedstring[]YesFiles that already existed and were skipped.
warningsstring[]YesWarning messages collected during init.
environmentInitProjectEnvironmentYesDetected project environment.
nextStepsstring[]YesNext steps for the user.
scriptsAddedstring[]YesScripts that were added to package.json (empty if none were added).

InitProjectArgs

Arguments for the init (project setup) command.

PropertyTypeRequiredDescription
cwdstring | undefinedNoProject root directory (default: cwd).
mvistring | undefinedNoMVI verbosity level for structured output.

DoctorCheckStatus

Status of a single doctor check.

DoctorCheckStatus

DoctorCheckResult

Result of a single doctor check.

PropertyTypeRequiredDescription
namestringYesName of the check.
statusDoctorCheckStatusYesStatus of the check.
messagestringYesHuman-readable message.
fixablebooleanYesWhether this issue can be auto-fixed with --fix.

DoctorResult

Result of the doctor command.

PropertyTypeRequiredDescription
successbooleanYesWhether all checks passed without errors.
checksDoctorCheckResult[]YesIndividual check results.
summary{ passed: number; warnings: number; errors: number; info: number; }YesSummary counts.
fixedstring[]YesFiles that were fixed (only populated when --fix is used).

DoctorArgs

Arguments for the doctor command.

PropertyTypeRequiredDescription
cwdstring | undefinedNoProject root directory (default: cwd).
fixboolean | undefinedNoAuto-fix resolvable issues.
mvistring | undefinedNoMVI verbosity level for structured output.

InitDocsResult

Result of the init docs command.

PropertyTypeRequiredDescription
successbooleanYesWhether the scaffold succeeded.
targetSSGTargetYesThe SSG target that was scaffolded.
summary{ filesCreated: number; dependencies: number; scripts: number; }YesSummary of what was created.
filesstring[]YesRelative paths of all files created.
instructionsstring[]YesPost-scaffold instructions for the user.

InitDocsArgs

Arguments for the init docs command.

PropertyTypeRequiredDescription
targetstring | undefinedNoSSG target to scaffold. Defaults to DEFAULT_TARGET.
cwdstring | undefinedNoProject root directory (default: cwd).
outDirstring | undefinedNoOutput directory for the doc site (default: outDir from config or ./docs).
forceboolean | undefinedNoOverwrite an existing scaffold without prompting.
mvistring | undefinedNoMVI verbosity level for structured output.

LockResult

Typed result for the lock command.

PropertyTypeRequiredDescription
successbooleanYesWhether the lock was successfully created.
lockFilestringYesPath to the lock file that was written.
lockedAtstringYesISO-8601 timestamp when the lock was created.
lockedBystringYesIdentifier of who created the lock.
locked{ rules: number; tsconfig: boolean; biome: boolean; }YesSummary of what was locked.
overwrotebooleanYesWhether a previous lock file was overwritten.

PrepublishResult

Typed result for the prepublish command.

PropertyTypeRequiredDescription
successbooleanYesWhether both check and build passed.
summary{ steps: number; passed: number; failed: number; duration: number; }YesSummary of the prepublish pipeline.
check{ success: boolean; errors: number; warnings: number; duration: number; }YesResult of the check step.
build{ success: boolean; steps: number; succeeded: number; failed: number; duration: number; } | undefinedNoResult of the build step (absent if check failed and build was skipped).
skippedReasonstring | undefinedNoIf check failed, the reason build was skipped.

PrepublishArgs

Arguments for the prepublish command.

PropertyTypeRequiredDescription
cwdstring | undefinedNoProject root directory (default: cwd).
strictboolean | undefinedNoTreat warnings as errors during the check step.
mvistring | undefinedNoMVI verbosity level for structured output.

TestArgs

Arguments for the test command.

PropertyTypeRequiredDescription
cwdstring | undefinedNoProject root directory (default: cwd).
mvistring | undefinedNoMVI verbosity level for structured output.

TestFailure

A single test failure entry, included at standard and full MVI levels.

PropertyTypeRequiredDescription
symbolstringYesSymbol name where the doctest failed.
filestringYesAbsolute path to the source file.
linenumberYes1-based line number of the failing example.
messagestringYesHuman-readable failure message.

TestResult

Typed result for the test command.

PropertyTypeRequiredDescription
successbooleanYesWhether all doctests passed.
summary{ passed: number; failed: number; total: number; duration: number; }YesAggregate counts — always present regardless of MVI level.
failuresTestFailure[] | undefinedNoPer-failure details — present at standard and full MVI levels.

UnlockResult

Typed result for the unlock command.

PropertyTypeRequiredDescription
successbooleanYesWhether the unlock was successful.
reasonstringYesThe reason provided for unlocking.
previousLockedBystring | nullYesWho originally locked the config, if known.
previousLockedAtstring | nullYesWhen the config was originally locked, if known.

On this page