Comprehensive command-line interface providing extensive configuration options for documentation generation.
Core command-line usage patterns for Compodoc.
# Basic documentation generation
compodoc -p <tsconfig.json> -d <output-directory>
# Generate and serve documentation
compodoc -p <tsconfig.json> -d <output-directory> -s
# Watch for changes during development
compodoc -p <tsconfig.json> -d <output-directory> -s -w
# Test documentation coverage
compodoc -p <tsconfig.json> --coverageTest 80
# Export documentation as JSON
compodoc -p <tsconfig.json> -d <output-directory> -e jsonFundamental configuration options for Compodoc operation.
interface BasicOptions {
/**
* TypeScript configuration file path
* @flag -p, --tsconfig
*/
tsconfig: string;
/**
* Output directory for generated documentation
* @flag -d, --output
* @default "./documentation/"
*/
output?: string;
/**
* Title for the documentation
* @flag -n, --name
* @default "Application documentation"
*/
name?: string;
/**
* Serve generated documentation
* @flag -s, --serve
* @default false
*/
serve?: boolean;
/**
* Watch source files for changes
* @flag -w, --watch
* @default false
*/
watch?: boolean;
/**
* Port for serving documentation
* @flag -r, --port
* @default 8080
*/
port?: number;
/**
* Host address for serving
* @flag --host
*/
host?: string;
/**
* Open documentation in browser after generation
* @flag -o, --open
*/
open?: boolean;
/**
* Silent mode - suppress log messages
* @flag -t, --silent
* @default false
*/
silent?: boolean;
}Usage Examples:
# Basic generation
compodoc -p tsconfig.json -d docs
# Serve with custom port
compodoc -p tsconfig.json -d docs -s -r 4200
# Watch mode with custom host
compodoc -p tsconfig.json -d docs -s -w --host 0.0.0.0
# Silent mode
compodoc -p tsconfig.json -d docs -tOptions for customizing the appearance of generated documentation.
interface ThemingOptions {
/**
* Documentation theme
* @flag --theme
* @options "gitbook" | "laravel" | "original" | "material" | "postmark" | "readthedocs" | "stripe" | "vagrant"
* @default "gitbook"
*/
theme?: string;
/**
* External styling theme file
* @flag -y, --extTheme
*/
extTheme?: string;
/**
* Custom favicon path
* @flag --customFavicon
*/
customFavicon?: string;
/**
* Custom logo path
* @flag --customLogo
*/
customLogo?: string;
/**
* Hide Compodoc generator link
* @flag --hideGenerator
* @default false
*/
hideGenerator?: boolean;
/**
* Hide dark mode toggle button
* @flag --hideDarkModeToggle
* @default false
*/
hideDarkModeToggle?: boolean;
}Usage Examples:
# Use material theme
compodoc -p tsconfig.json -d docs --theme material
# Custom theme and logo
compodoc -p tsconfig.json -d docs --extTheme custom.css --customLogo logo.png
# Hide generator link and dark mode toggle
compodoc -p tsconfig.json -d docs --hideGenerator --hideDarkModeToggleOptions for controlling what content is included in the documentation.
interface ContentOptions {
/**
* External assets folder to copy
* @flag -a, --assetsFolder
*/
assetsFolder?: string;
/**
* Path to external markdown files
* @flag --includes
*/
includes?: string;
/**
* Name for external markdown files menu item
* @flag --includesName
* @default "Additional documentation"
*/
includesName?: string;
/**
* Path to custom Handlebars templates directory
* @flag --templates
*/
templates?: string;
/**
* Files provided by external tool for coverage
* @flag --files
*/
files?: string | string[];
}Usage Examples:
# Include external assets and markdown
compodoc -p tsconfig.json -d docs -a assets --includes additional-docs
# Custom templates
compodoc -p tsconfig.json -d docs --templates custom-templates
# Custom includes name
compodoc -p tsconfig.json -d docs --includes docs --includesName "API Guides"Options for enabling/disabling specific documentation features.
interface FeatureToggleOptions {
/**
* Disable dependency graph generation
* @flag --disableGraph
* @default false
*/
disableGraph?: boolean;
/**
* Disable coverage report generation
* @flag --disableCoverage
* @default false
*/
disableCoverage?: boolean;
/**
* Disable source code tabs and links
* @flag --disableSourceCode
* @default false
*/
disableSourceCode?: boolean;
/**
* Disable DOM tree tab
* @flag --disableDomTree
* @default false
*/
disableDomTree?: boolean;
/**
* Disable template tab for components
* @flag --disableTemplateTab
* @default false
*/
disableTemplateTab?: boolean;
/**
* Disable style tab for components
* @flag --disableStyleTab
* @default false
*/
disableStyleTab?: boolean;
/**
* Disable routes graph
* @flag --disableRoutesGraph
* @default false
*/
disableRoutesGraph?: boolean;
/**
* Disable search functionality
* @flag --disableSearch
* @default false
*/
disableSearch?: boolean;
/**
* Disable dependencies list
* @flag --disableDependencies
* @default false
*/
disableDependencies?: boolean;
/**
* Disable properties list
* @flag --disableProperties
* @default false
*/
disableProperties?: boolean;
}Options for controlling visibility of class members and lifecycle methods.
interface VisibilityOptions {
/**
* Hide private members in documentation
* @flag --disablePrivate
* @default false
*/
disablePrivate?: boolean;
/**
* Hide protected members in documentation
* @flag --disableProtected
* @default false
*/
disableProtected?: boolean;
/**
* Hide @internal members in documentation
* @flag --disableInternal
* @default false
*/
disableInternal?: boolean;
/**
* Hide Angular lifecycle hooks in documentation
* @flag --disableLifeCycleHooks
* @default false
*/
disableLifeCycleHooks?: boolean;
/**
* Hide constructors in documentation
* @flag --disableConstructors
* @default false
*/
disableConstructors?: boolean;
}Options for testing and reporting documentation coverage.
interface CoverageOptions {
/**
* Test documentation coverage with threshold
* @flag --coverageTest
* @default 70
*/
coverageTest?: number;
/**
* Test coverage per file with minimum threshold
* @flag --coverageMinimumPerFile
* @default 0
*/
coverageMinimumPerFile?: number;
/**
* Fail with error or warn on coverage threshold failure
* @flag --coverageTestThresholdFail
* @options true | false
* @default true
*/
coverageTestThresholdFail?: boolean;
/**
* Show only failed files in coverage test
* @flag --coverageTestShowOnlyFailed
* @default false
*/
coverageTestShowOnlyFailed?: boolean;
/**
* Include unit test coverage from istanbul JSON summary
* @flag --unitTestCoverage
*/
unitTestCoverage?: string;
}Usage Examples:
# Test coverage with 80% threshold
compodoc -p tsconfig.json --coverageTest 80
# Per-file coverage testing
compodoc -p tsconfig.json --coverageMinimumPerFile 50
# Include unit test coverage
compodoc -p tsconfig.json --unitTestCoverage coverage/coverage-summary.json
# Coverage testing with warnings instead of errors
compodoc -p tsconfig.json --coverageTest 70 --coverageTestThresholdFail falseOptions for output format and internationalization.
interface ExportLanguageOptions {
/**
* Export format for documentation
* @flag -e, --exportFormat
* @options "html" | "json"
* @default "html"
*/
exportFormat?: "html" | "json";
/**
* Language for generated documentation
* @flag --language
* @options "bg-BG" | "de-DE" | "en-US" | "es-ES" | "fr-FR" | "hu-HU" | "it-IT" | "ja-JP" | "ko-KR" | "nl-NL" | "pl-PL" | "pt-BR" | "ru-RU" | "sk-SK" | "zh-CN" | "zh-TW"
* @default "en-US"
*/
language?: string;
}Options for customizing navigation and menu behavior.
interface NavigationOptions {
/**
* Close menu items by default
* @flag --toggleMenuItems
* @options ["all"] | ["modules", "components", "directives", "controllers", "entities", "classes", "injectables", "guards", "interfaces", "interceptors", "pipes", "miscellaneous", "additionalPages"]
* @default ["all"]
*/
toggleMenuItems?: string[];
/**
* Navigation tab configuration
* @flag --navTabConfig
* @description JSON array of tab objects with "id" and "label" properties
*/
navTabConfig?: string;
/**
* Maximum search results to display
* @flag --maxSearchResults
* @default 15
*/
maxSearchResults?: number;
}Options for integrating with Google Analytics.
interface AnalyticsOptions {
/**
* Google Analytics tracking ID
* @flag --gaID
*/
gaID?: string;
/**
* Google Analytics site name
* @flag --gaSite
* @default "auto"
*/
gaSite?: string;
}Special mode that disables multiple features for lightweight documentation.
interface MinimalOptions {
/**
* Minimal mode - disables search, graph, and coverage
* @flag --minimal
* @default false
* @effect Sets disableSearch, disableRoutesGraph, disableGraph, and disableCoverage to true
*/
minimal?: boolean;
}Usage Examples:
# Export as JSON
compodoc -p tsconfig.json -d docs -e json
# German language documentation
compodoc -p tsconfig.json -d docs --language de-DE
# Minimal mode for fast generation
compodoc -p tsconfig.json -d docs --minimal
# Custom navigation and analytics
compodoc -p tsconfig.json -d docs --gaID UA-123456-1 --maxSearchResults 25