CommandBox Output

Generate CommandBox CLI command documentation with namespace organization

🎯 The CommandBox Strategy is a specialized output format designed specifically for documenting CommandBox CLI commands and namespaces. It extends the HTML API Strategy with CLI-focused terminology and navigation.

πŸš€ Overview

The CommandBox Strategy transforms CommandBox command components into searchable, navigable HTML documentation with command-specific features:

  • Command-Centric Navigation - Organizes by command namespaces (not packages)

  • CLI Terminology - Uses "commands" and "namespaces" instead of "classes" and "packages"

  • Qualified Names - Displays full command paths (e.g., server start, package show)

  • Namespace Hierarchy - Visualizes command organization and nesting

  • Frames Theme - Uses traditional frameset layout for CLI documentation

πŸ“¦ Properties

The CommandBox Strategy accepts the following configuration properties:

Property
Type
Required
Description

outputDir

string

Yes

Output directory absolute path

projectTitle

string

No

HTML title for documentation (default: "Untitled")

🎯 Basic Usage

Using Strategy Alias

Using Full Class Path

πŸ“‚ Generated Structure

The CommandBox Strategy generates the following file structure:

🎨 Features

Command Path Display

Unlike standard class documentation, CommandBox Strategy shows the full command path:

Namespace Organization

Commands are grouped by their namespace hierarchy:

  • server namespace

    • start command

    • stop command

    • restart command

  • package namespace

    • show command

    • set command

    • install command

CLI-Focused Templates

The strategy uses specialized templates that:

  • Display command syntax and usage

  • Show command examples in CLI format

  • Highlight command parameters and flags

  • Use CLI-appropriate terminology

πŸ“‹ Real-World Examples

Documenting CommandBox Core

Generate documentation for CommandBox's built-in commands:

Custom CommandBox Module

Document your own CommandBox module commands:

Multiple Command Modules

Document multiple CommandBox modules together:

πŸ”§ Technical Details

Strategy Implementation

The CommandBox Strategy:

  • Extends: docbox.strategy.api.HTMLAPIStrategy

  • Template Path: /docbox/strategy/CommandBox/resources/templates

  • Assets Path: /docbox/strategy/api/themes/frames/resources/static

Metadata Augmentation

The strategy augments the standard metadata query with additional columns:

  • command - The command name extracted from the component

  • namespace - The namespace path for the command

Template Overrides

CommandBox Strategy overrides specific templates:

  • class.cfm - Modified to show command syntax

  • package-summary.cfm - Shows namespace commands

  • overview-summary.cfm - Lists all namespaces

⚠️ Important Notes

  1. Theme Locked: CommandBox Strategy always uses the frames theme for consistency

  2. Command Components: Expects CommandBox command component structure

  3. Namespace Detection: Automatically extracts namespace from component metadata

  4. Asset Sharing: Reuses frames theme assets for stability

πŸ’‘ Tips

  • Use consistent naming conventions for command components

  • Add comprehensive JavaDoc comments to commands

  • Document command parameters with @hint attributes

  • Include usage examples in command descriptions

  • Group related commands under the same namespace

Last updated

Was this helpful?