Skip to content
jsdoc-to-tsdoc

Menu

CLI reference

Every command, every flag, which commands look at test files, and the exit codes, in one place.

jsdoc-to-tsdoc init | scan | convert | scaffold | escalate | check | merge-driver

Run jsdoc-to-tsdoc <command> --help for the flags of one command.

Commands

CommandPurposeWrites
initBootstrap tsdoc.json and the ESLint rulesConfig files
scanInventory the JSDoc a conversion would touch, or classify documentation qualityNothing
convertTransform JSDoc comments into TSDocSource files
scaffoldGenerate TSDoc stubs for exports with no documentationSource files
escalateRaise tsdoc-require-2/require from warn to error after a preflightESLint config
checkCI gate: validate TSDoc, report undocumented exportsNothing
merge-driverGit merge driver for the severity line. Called by git, not by handMerged file

Options

FlagCommandsPurpose
--cwd <dir>allProject directory to scan, default .
--dry-run, --previewinit, convert, scaffold, escalateShow a diff without writing
--strictinitStart tsdoc-require-2/require at error instead of warn
--installinitRun the detected package manager to install missing dev dependencies
--checkconvert, scaffold, escalateCI mode: exit 3 if anything would change, never write
--interactive, -iconvert, scaffoldReview each changed file: accept, skip, edit in $EDITOR, quit. Needs a terminal, and cannot be combined with --dry-run, --preview, --check or --report
--litescan, convertOnly @param and @returns hygiene
--promote-line-commentsconvertRewrite // prose above an undocumented export as a /** */ comment
--membersscaffoldAlso stub each undocumented interface or type-literal member
--severity <level>escalateerror (default) or warn to walk it back
--skip-preflightescalatePatch the config without running ESLint first
--syntax-onlycheckOnly validate syntax, ignore missing exports and legacy JSDoc
--classifyscanReport documentation topology and confidence. Not combinable with --lite
--fail-on-missingscanExit 3 when any export has no TSDoc comment, implies --classify
--fail-on-stalescanExit 3 when any comment contradicts its signature, implies --classify
--include-testscheck, scaffold, scan --classifyAlso inspect the test paths init exempts
--only <globs>scan, convert, scaffold, checkComma-separated globs to include, for example "src/lib/**"
--exclude <globs>scan, convert, scaffold, checkComma-separated globs to exclude, for example "**/*.test.ts"
--report <fmt>allMachine-readable output, json or md, on stdout
--enrich <provider>scanModel suggestions for LOW and STALE exports: copilot, ollama or anthropic. Off by default

Which commands look at test files

Not all of them, and the split is deliberate. init writes an ESLint config that turns both TSDoc rules off for test paths, so a command’s default should match what that config grades.

CommandTest pathsWhy
checkskippedIt is a gate, and reporting what init’s own config excuses is phantom work
scaffoldskippedIt writes, and a stub in an ungraded file is a TODO nobody will ever be asked to fill
scan --classifyskippedIt measures the same thing check gates on
scan (inventory)includedIt counts what convert would rewrite
convertincludedIt rewrites JSDoc that already exists, and malformed JSDoc is malformed anywhere

--include-tests opts the first three back in. To keep convert away from tests, use --exclude "**/*.test.ts,**/__tests__/**".

Exit codes

CodeMeaning
0OK
1Logic error, such as an invalid flag combination
2Parse failure, or a tsdoc.json that cannot be read
3Violations, or with --check something would change

Runtimes

The commands run through npx, yarn dlx and pnpm dlx, and all three are tested against a packed tarball on real projects, not assumed to be equivalent.

See also

init, scan, convert, scaffold, escalate and check each explain what they do and why.