Skip to content
Latchkey

typedoc --out: Generate TypeScript API Docs

typedoc --out <dir> reads your TypeScript entry points and emits an HTML API reference from the types and TSDoc comments.

TypeDoc uses the TypeScript compiler to produce accurate API docs from types, so it needs a valid tsconfig. In CI, --treatWarningsAsErrors keeps undocumented or broken references from slipping through.

What it does

typedoc loads your tsconfig, resolves the configured entry points, and generates an HTML site (or JSON with --json) describing exported types, functions, and their TSDoc comments. Configuration can live in typedoc.json or the CLI.

Common usage

Terminal
typedoc --out docs src/index.ts
# multiple entry points, fail on any warning
typedoc --entryPoints src/index.ts src/plugin.ts \
  --out docs --treatWarningsAsErrors
# machine-readable output
typedoc --json docs/api.json src/index.ts

Options

FlagWhat it does
--out <dir>Output directory for HTML docs
--entryPoints <files>Entry modules to document
--tsconfig <file>Path to the TypeScript config
--treatWarningsAsErrorsExit non-zero if TypeDoc emits warnings
--json <file>Also emit a JSON model of the docs
--excludePrivateSkip members marked private
--plugin <name>Load a TypeDoc plugin

In CI

Add --treatWarningsAsErrors so unresolved @link tags and missing entry points fail the pipeline. Keep TypeDoc pinned to a version compatible with your TypeScript; a mismatch is a frequent CI break. Cache node_modules, not the docs output.

Common errors in CI

Unable to find any entry points. See previous warnings. means --entryPoints did not resolve; check the paths and tsconfig include. [warning] The signature ... has no documentation becomes fatal with --treatWarningsAsErrors. Error: TypeDoc requires a version of TypeScript between ... but 5.x was found is the version-mismatch failure.

Related guides

Run this faster and cheaper on Latchkey managed runners. Start free →