BoxLang CLI Tool
𦀠DocBox 5.0+ includes a native BoxLang module with a powerful CLI tool for generating documentation directly from the command line.
π¦ Installation
DocBox can be installed as a BoxLang core module using the bx-docbox slug:
CommandBox Web Runtimes
box install bx-docboxBoxLang OS Runtime
install-bx-module bx-docboxOnce installed, the boxlang module:docbox command becomes available for generating documentation.
π― Usage
boxlang module:docbox [options]βοΈ Required Options
--output-dir=<path>
-o=<path>
π Output directory for generated docs
π Source Options
--source=<path>
Source directory to document
--mapping=<name>
Base mapping for the source folder
--mappings:<name>=<path>
Define multiple source mappings
βοΈ Additional Options
--help
-h
Show help information
--version
-v
Show version information
--excludes=<regex>
Regex pattern to exclude files/folders
--project-title=<title>
π Project title for documentation
--theme=<name>
π¨ Theme name (default or frames)
--strategy=<class>
Documentation strategy class (default: docbox.strategy.api.HTMLAPIStrategy)
π‘ Examples
π Basic Usage
Generate documentation for a single source directory:
π With Project Title and Excludes
π Short Form Output Directory
π Multiple Source Mappings
Document multiple source directories with different mappings:
π Using Frames Theme
Generate documentation with the traditional frameset layout:
π JSON Array Format
Specify multiple sources using JSON array notation:
π Real-World Example: ColdBox Framework
π§ Command Output
When you run the CLI tool, you'll see output like this:
π Getting Help
Show Help
This displays comprehensive usage information including:
Command syntax
All available options
Multiple examples
Links to documentation
Show Version
Displays:
DocBox version
Author information
Website URL
β οΈ Common Issues
Missing Source Mappings
Error:
Solution: Ensure you provide either:
--sourceand--mappingtogetherOne or more
--mappings:<name>=<path>optionsJSON array via
--source
Missing Output Directory
Error:
Solution: Always specify where to generate documentation:
Source Directory Not Found
Warning:
Solution: Verify the source path exists and is accessible. Use absolute paths or paths relative to your current working directory.
π¨ Theme Selection
DocBox 5.0+ includes two modern themes:
Default Theme (Alpine.js SPA)
Features:
β‘ Alpine.js-based SPA
π Dark mode support
π Real-time search
π Method tabs
π Modern purple design
Frames Theme (Traditional)
Features:
ποΈ Traditional frameset layout
π jstree navigation
π± Left sidebar for packages
π― Bootstrap 5 styling
π Integration with Build Scripts
CommandBox Task Runner
Create a task.cfc to generate documentation:
Run with: box task run
CI/CD Pipeline
Add to your GitHub Actions, GitLab CI, or other CI/CD pipeline:
π Next Steps
Configuration Options - Learn about strategy properties and advanced configuration
HTML Output - Explore HTML theme features
Annotating Your Code - Write effective JavaDoc comments
Last updated
Was this helpful?