# Options

TypeDoc accepts most of the command line arguments that the TypeScript compiler accepts. All command line arguments that are passed in without a flag will be parsed as input files. TypeDoc also accepts directories as input files. Any options passed on the command line will override options set in a configuration file.

$ typedoc --out path/to/documentation/ path/to/typescript/project/

# Configuration Options

These options control where TypeDoc reads its configuration from.

# options

$ typedoc --options <filename>

Specify a json option file that should be loaded. If not specified TypeDoc will look for typedoc.json and typedoc.js in the current directory. The JSON file should return an object whose keys are the option names. For example:

{
  "inputFiles": ["./src"],
  "mode": "modules",
  "out": "doc"
}

# tsconfig

$ typedoc --tsconfig </path/to/tsconfig.json>

Specify a tsconfig.json file that options should be read from. If not specified TypeDoc will look for tsconfig.json in the current directory and parent directories like tsc does.

When TypeDoc loads a tsconfig.json file, it will read options declared under the typedocOptions key and take the tsconfig.json’s input files (as defined by files or include/exclude) as the input files.

# Input Options

These options control what files TypeDoc processes to generate documentation and how the files are processed.

# inputFiles

$ typedoc a b
# or
$ typedoc --inputFiles a --inputFiles b

Specifies the initial input files to be passed to TypeScript. The --inputFiles specifier on the command line is optional. Any argument without a corresponding option name will be parsed as an input file. This option may also accept directories, which will be recursively expanded with all files being added to the input files.

# mode

$ typedoc --mode <file|modules>

Specifies how the project should be converted.

--mode file
Treat all input files as global, should only be used for projects which have module set to none in their tsconfig.json.
--mode modules
Document each file in the project as its own module, most useful for projects generating documentation for internal use.
"library mode" (WIP - See #1364)
Document each expanded input file as an entry point to a library, resolving all exports of that file as belonging to that library.
If a directory is specified as an input file, all files within that directory and child directories will be treated as an entry point.
Available as a beta with `npm i [email protected]`

# includeDeclarations

$ typedoc --includeDeclarations

Turns on parsing of .d.ts declaration files. Defaults to false. If you enable this, you should almost certainly also turn on --excludeExternals to avoid documenting lib files.

# entryPoint

$ typedoc --entryPoint '"index"'

Specifies the root symbol, defaults to the global symbol that all modules are placed under.

# exclude

$ typedoc --exclude "**/*+(index|.spec|.e2e).ts"

Exclude files by the given pattern when a path is provided as source. Supports minimatch patterns. In configuration files, this option accepts an array of patterns. On the command line, it may be specified multiple times to add multiple patterns.

# externalPattern

$ typedoc --externalPattern 'lib/**/*.ts' --externalPattern 'external/**/*.ts'

Define patterns for extra files that should be considered external. Can be used along with --excludeExternals to remove external modules from the documentation. Even if not specified, some files may not be considered external if they were not specified in the expanded input files.

# excludeExternals

$ typedoc --excludeExternals

Prevent externally resolved TypeScript files from being documented. Defaults to false.

# excludeNotExported

$ typedoc --excludeNotExported

Removes local symbols from the generated documentation. Defaults to false.

# excludePrivate

$ typedoc --excludePrivate

Removes private class members from the generated documentation. Defaults to false.

# excludeProtected

$ typedoc --excludeProtected

Removes protected class members from the generated documentation. Defaults to false.

# stripInternal

$ typedoc --stripInternal

Removes members annotated with the @internal comment recognized by TypeScript.

# ignoreCompilerErrors

$ typedoc --ignoreCompilerErrors

Generate documentation even if the project has TypeScript errors. If you only generate docs after a successful build, enabling this option will provide performance benefits.

# media

$ typedoc --media <path/to/media/>

Specifies a media directory that will be copied to the output file. Media can be linked to with media://file.jpg in doc comments.

# includes

$ typedoc --includes <path/to/includes/>

Specifies a directory with files that can be injected into the generated documentation with [[include:file.md]] in a doc comment.

# Output Options

These options control TypeDoc’s output.

# out

$ typedoc --out <path/to/documentation/>

Specifies the location the html documentation should be written to.

# json

$ typedoc --json <path/to/out-file.json>

Specifies the location to output a JSON file containing all of the reflection data.

# theme

$ typedoc --theme <default|minimal|path/to/theme>

Specify the path to the theme that should be used. TypeDoc includes the default and minimal themes, which may be specified without the full path to the theme.

# name

$ typedoc --name <Documentation title>

Set the name of the project that will be used in the header of the template. The name defaults to the package name and current version according to your package.json.

# includeVersion

$ typedoc --name "Name" --includeVersion

Adds the package version to the project’s name. In this case, if the project was on version 1.2.3 according to package.json, this would generate documentation called “Name - v1.2.3”

# disableSources

$ typedoc --disableSources

Disables the defined in text describing where a reflection was created.

# excludeTags

$ typedoc --excludeTags apidefine

Specify tags that should be removed from doc comments when parsing. Useful if your project uses apiDoc for documenting RESTful web APIs.

# readme

$ typedoc --readme <path/to/readme|none>

Path to the readme file that should be displayed on the index page. Pass none to disable the index page and start the documentation on the globals page.

# categorizeByGroup

$ typedoc --categorizeByGroup false

This flag categorizes reflections by group (within properties, methods, etc). To allow methods and properties of the same category to be grouped together, set this flag to false. Defaults to true.

# defaultCategory

$ typedoc --defaultCategory "Category Name"

Sets the name for the default category which is used when only some elements of the page are categorized. Defaults to ‘Other’

# categoryOrder

command line:

$ typedoc --categoryOrder "Category Name" --categoryOrder "Other Category" --categoryOrder "*"

typedoc.json:

{
  "categoryOrder": ["Category Name", "Other Category", "*"]
}

Array option which allows overriding the order categories display in. A string of * indicates where categories that are not in the list should appear.

By default, categories are displayed alphabetically. If unknown categories are found, they will be listed at the end by default.

# gitRevision

$ typedoc --gitRevision <revision|branch>

Use specified revision or branch instead of the last revision for linking to GitHub source files.

# gitRemote

$ typedoc --gitRemote <remote>

Use the specified git remote instead of origin for linking to GitHub source files. You can use git remote to view a list of valid remotes. If you are updating documentation for a forked package, you probably want to pass --gitRemote upstream.

# gaID

$ typedoc --gaID

Set the Google Analytics tracking ID and activate tracking code.

# gaSite

$ typedoc --gaSite <site>

Set the site name for Google Analytics. Defaults to auto.

# hideGenerator

$ typedoc --hideGenerator

Do not print the TypeDoc link at the end of the page. Defaults to false.

# toc

$ typedoc --toc EntryClass,ImportantInterface
{
  "toc": [
    "EntryClass",
    "ImportantInterface"
  ]
}

Overrides the “globals” navigation sidebar to only include the types provided in the “toc” whitelist. This is useful in large projects where there may be an unwieldy number of Globals in the sidebar.

# disableOutputCheck

$ typedoc --disableOutputCheck

Disables checking and clearing of the output directory specified with --out.

# General Options

Options which don’t fit elsewhere.

# help

$ typedoc --help

The help command will print the following listing of available commands.

Usage:
 typedoc --mode modules --out path/to/documentation path/to/sourcefiles

TypeDoc options:
 --categorizeByGroup       Specifies whether categorization will be done at the group level.
 --categoryOrder           Specifies the order in which categories appear. * indicates the relative order for categories not in the list.
 --defaultCategory         Specifies the default category for reflections without a category.
 --disableOutputCheck      Should TypeDoc disable the testing and cleaning of the output directory?
 --entryPoint              Specifies the fully qualified name of the root symbol. Defaults to global namespace.
 --exclude                 Define patterns for excluded files when specifying paths.
 --excludeExternals        Prevent externally resolved TypeScript files from being documented.
 --excludeNotExported      Prevent symbols that are not exported from being documented.
 --excludePrivate          Ignores private variables and methods
 --excludeProtected        Ignores protected variables and methods
 --externalPattern         Define patterns for files that should be considered being external.
 --gaID                    Set the Google Analytics tracking ID and activate tracking code.
 --gaSite                  Set the site name for Google Analytics. Defaults to `auto`.
 --gitRevision             Use specified revision instead of the last revision for linking to GitHub source files.
 -h, --help                Print this message.
 --hideGenerator           Do not print the TypeDoc link at the end of the page.
 --ignoreCompilerErrors    Should TypeDoc generate documentation pages even after the compiler has returned errors?
 --includeDeclarations     Turn on parsing of .d.ts declaration files.
 --includes DIRECTORY      Specifies the location to look for included documents (use [[include:FILENAME]] in comments).
 --json                    Specifies the location and file name a json file describing the project is written to.
 --listInvalidSymbolLinks  Emits a list of broken symbol [[navigation]] links after documentation generation
 --logger                  Specify the logger that should be used, 'none' or 'console'
 --media DIRECTORY         Specifies the location with media files that should be copied to the output directory.
 --mode                    Specifies the output mode the project is used to be compiled with: 'file' or 'modules'
 --name                    Set the name of the project that will be used in the header of the template.
 --options                 Specify a js option file that should be loaded. If not specified TypeDoc will look for 'typedoc.js' in the current directory.
 --out DIRECTORY           Specifies the location the documentation should be written to.
 --plugin                  Specify the npm plugins that should be loaded. Omit to load all installed plugins, set to 'none' to load no plugins.
 --readme                  Path to the readme file that should be displayed on the index page. Pass `none` to disable the index page and start the documentation on the globals page.
 --theme                   Specify the path to the theme that should be used or 'default' or 'minimal' to use built-in themes.
 --toc                     Specifies the top level table of contents.
 --tsconfig                Specify a typescript config file that should be loaded. If not specified TypeDoc will look for 'tsconfig.json' in the current directory.
 -v, --version             Print the TypeDoc's version.

TypeScript options:
See https://www.typescriptlang.org/docs/handbook/compiler-options.html

# version

$ typedoc --version

Prints TypeDoc’s version.

# plugin

$ typedoc --plugin <none|plugin>

Specifies the plugins that should be loaded. By default, all installed npm packages with typedocplugin in their keywords will be loaded.

# logger

$ typedoc --logger <none|Function>

Specifies the logger to write output to. When using TypeDoc programmatically, a function may be specified that will be called with the log message. By default, logs to the console. none may be passed to disable logging.

$ typedoc --listInvalidSymbolLinks

Tells TypeDoc to report any [[symbol name]] links that are broken.