For the complete documentation index, see llms.txt. This page is also available as Markdown.

BoxLang CLI Tool

Get started with the BoxLang CLI tool for generating documentation

🦤 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-docbox

BoxLang OS Runtime

install-bx-module bx-docbox

Once installed, the boxlang module:docbox command becomes available for generating documentation.


🎯 Usage

boxlang module:docbox [options]

⚙️ Required Options

Option
Short
Description

--output-dir=<path>

-o=<path>

📁 Output directory for generated docs

📂 Source Options

Option
Description

--source=<path>

Source directory to document

--mapping=<name>

Base mapping for the source folder

--mappings:<name>=<path>

Define multiple source mappings

⚙️ Additional Options

Option
Short
Description

--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:

  • --source and --mapping together

  • One or more --mappings:<name>=<path> options

  • JSON 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

Last updated

Was this helpful?