Command-Line Interface
The Kampose CLI follows a command-based structure where you specify a command followed by command-specific options and arguments:
kampose <command> [OPTIONS] [ARGUMENTS]
When you run Kampose without a command, or with --help or -h, it displays help information. Use --version or -v to show the current version.
Commands
build
Generates documentation from .NET assemblies and XML comments.
The build command processes your .NET assemblies and XML documentation files to create API documentation using your chosen theme.
Usage
kampose build [OPTIONS] [config-file]
Arguments
config-file- Path to your configuration file. Defaults tokampose.jsonin the current directory if not specified. You can omit the.jsonextension and it will be added automatically.
Options
-c, --clean- Clear the output directory before generating documentation.-d, --debug- Enable detailed logging to help diagnose issues during the documentation generation process.-h, --help- Show help information for the build command.
The
--cleanoption deletes every existing file in the configured output directory before generation. VerifyoutputDirectorybefore using it, especially in automated builds.
The
--debugoption increases logging verbosity when output is redirected, such as to a log file or CI system. In normal console output, it only enables stack traces for unhandled exceptions.
Examples
# Use the default configuration file (kampose.json)
kampose build
# Use a custom configuration file
kampose build custom-config.json
# Specify a configuration file without the .json extension
kampose build my-config
# Generate documentation with debug output
kampose build my-config --debug > log.txt
# Clean the output directory before generating documentation
kampose build --clean
help
Shows help information about commands.
Use the help command to learn about Kampose's commands. When called without arguments, it lists all available commands. Specify a command name to see detailed help for that specific command.
Usage
kampose help [command]
Arguments
command- Optional. Name of the command to show help for.
Options
-h, --help- Show help information for the help command.
Examples
# Show general help and list all commands
kampose help
# Show help for the build command
kampose help build
# Alternative ways to show general help
kampose --help
kampose -h
validate
Runs every validation of the build command without generating any file.
The validate command loads the configuration, theme, assemblies, XML documentation, and topics, audits the XML documentation, renders every page, bundles the theme scripts and styles, checks that every asset can be read, and verifies the referenced URLs, exactly as build does. It reports the same errors and warnings and returns the same exit codes, but creates, changes, or deletes nothing in the output directory. Use it to check documentation in pull requests or before a build.
Usage
kampose validate [OPTIONS] [config-file]
Arguments
config-file- Path to your configuration file. Defaults tokampose.jsonin the current directory if not specified. You can omit the.jsonextension and it will be added automatically.
Options
-d, --debug- Enable detailed logging to help diagnose issues during validation.-h, --help- Show help information for the validate command.
Because nothing is written,
validatecannot detect failures that occur only when writing files, such as missing permissions on the output directory or a full disk. WhenverifyExternalLinksis enabled, it sends the same requests to external URLs asbuild.
Examples
# Validate using the default configuration file (kampose.json)
kampose validate
# Validate using a custom configuration file
kampose validate custom-config.json
version
Shows the current version of Kampose.
Usage
kampose version [OPTIONS]
Options
-h, --help- Show help information for the version command.
Examples
# Show version information
kampose version
# Alternative ways to show version
kampose --version
kampose -v
Global Options
--help,-h- Show general help when used in place of a command, or help for a command when placed after it, as inkampose build --help.--version,-v- Show version information. This option is recognized only in place of a command, as inkampose --version;kampose build --versionreports an unknown option.
Exit Codes
Kampose returns these exit codes to indicate what happened:
0- Success. Warnings may still have been reported.1- The run finished, but errors were reported, such as a page that failed to render or an asset that could not be copied.2- Invalid command, option, or argument.3- Validation failed: the configuration or theme is invalid, no assemblies matched theassembliespatterns, orstopOnIssuesstopped the run because of documentation or link issues.4- Any other error, such as a missing configuration file.
