BoxLang ๐Ÿš€ A New JVM Dynamic Language Learn More...

ColdBox CLI

v8.0.0+17 CommandBox Modules

ColdBox CLI


ColdBox Snapshots Total Downloads Latest Stable Version Apache2 License

Copyright Since 2005 ColdBox Platform by Luis Majano and Ortus Solutions, Corp
www.coldbox.org | www.ortussolutions.com


This is the official ColdBox CLI for CommandBox. It is a collection of commands to help you work with ColdBox and its ecosystem for building, testing, and deploying BoxLang and CFML applications. It provides commands for scaffolding applications, creating tests, modules, models, views, and much more.

License

Apache License, Version 2.0.

ColdBox CLI Versions

The CLI matches the major version of ColdBox. Current version: 8

  • If you are using ColdBox 8, use CLI @8 (recommended)
  • If you are using ColdBox 7, use CLI @7.8.0 (recommended)
  • If you are using ColdBox 6, use CLI @6 (legacy support)

This versioning ensures you get the correct commands and features for your version of ColdBox.

Installation

Install the commands via CommandBox like so:

box install coldbox-cli

Usage

The ColdBox CLI provides powerful scaffolding and development tools for both CFML and BoxLang applications. All commands support the --help flag for detailed information.

๐Ÿ“ฑ Application Creation

Create new ColdBox applications from various templates. BoxLang is now the default language for new applications:

# Create a basic ColdBox app (BoxLang by default)
coldbox create app myApp
coldbox create app myApp --boxlang   # Force BoxLang (default)

# Create a CFML app explicitly
coldbox create app myApp --cfml

# Create with specific templates
coldbox create app myApp skeleton=modern
coldbox create app myApp skeleton=rest
coldbox create app myApp skeleton=flat

# Create with additional features
coldbox create app myApp --migrations     # Database migrations support
coldbox create app myApp --docker         # Docker environment setup
coldbox create app myApp --vite          # Vite frontend asset building
coldbox create app myApp --rest          # REST API configuration

# Combine multiple features
coldbox create app myApp --migrations --docker --vite

# Interactive app wizard (recommended for beginners)
coldbox create app-wizard

๐Ÿง™โ€โ™‚๏ธ Interactive App Wizard

The app-wizard command provides an interactive, step-by-step process for creating new applications. It's perfect for beginners or when you want to explore all available options:

coldbox create app-wizard

The wizard will guide you through:

  1. Project Location: Whether to create in current directory or a new folder
  2. Language Selection: Choose between BoxLang (default) or CFML
  3. Project Type: API/REST service or full web application
  4. Frontend Setup: Optional Vite integration for web applications
  5. Environment: Optional Docker containerization
  6. Database: Optional migrations support

Example Wizard Flow:

Are you currently inside the "myapp" folder? [y/n]: n
Is this a BoxLang project? [y/n]: y
Are you creating an API? [y/n]: n
Would you like to configure Vite as your Front End UI pipeline? [y/n]: y
Would you like to setup a Docker environment? [y/n]: y
Are you going to require Database Migrations? [y/n]: y

Application Templates

The CLI supports multiple application templates (skeletons), or you can use your own via any FORGEBOX ID, GitHub repo, local path, zip or URL. BoxLang templates are now the primary focus for modern development:

  • boxlang (default) - A modern ColdBox app using BoxLang as the primary language with latest features
  • modern - A modern ColdBox app supporting both BoxLang and CFML with contemporary architecture
  • rest - A ColdBox REST API template optimized for BoxLang development

๐Ÿ“œ Legacy CFML Templates

  • flat - A classic ColdBox app with a flat structure for traditional CFML development
  • rest-hmvc - A RESTful ColdBox app using HMVC architecture
  • supersimple - A bare-bones template for minimal setups
  • vite - A ColdBox app integrated with Vite for frontend development (legacy)

๐Ÿš€ Template Features

Modern templates (boxlang, modern) support additional features via flags:

  • --vite - Integrates Vite for modern frontend asset building and hot reloading
  • --rest - Configures the application as a REST API service
  • --docker - Includes Docker configuration for containerized development
  • --migrations - Sets up database migrations support

โšก Vite Integration

The CLI now supports Vite integration for modern frontend development with hot module replacement and optimized builds:

# Create app with Vite support
coldbox create app myApp --vite

# Available for BoxLang and Modern templates
coldbox create app myApp skeleton=modern --vite

Vite Features Included:

  • Pre-configured vite.config.mjs with ColdBox/BoxLang integration
  • Hot module replacement (HMR) for development
  • Optimized production builds with code splitting
  • Asset preprocessing for CSS, SCSS, JavaScript, and TypeScript
  • Development server with proxy configuration
  • Build scripts in package.json

Development Workflow:

# Start development server with hot reloading
npm run dev

# Build for production
npm run build

# Preview production build
npm run preview

๐Ÿณ Docker Integration

The CLI provides Docker integration to containerize your ColdBox applications for consistent development and deployment environments:

# Create app with Docker support
coldbox create app myApp --docker

# Combine with other features
coldbox create app myApp --docker --vite --migrations

Docker Features Included:

  • Multi-stage Dockerfile optimized for ColdBox applications
  • docker-compose.yml for local development with services
  • Database service configuration (PostgreSQL/MySQL)
  • Redis caching service setup
  • Environment variable configuration
  • Production-ready container optimization
  • Health checks and monitoring setup

Docker Commands:

# Build and start development environment
docker-compose up -d

# View logs
docker-compose logs -f

# Stop services
docker-compose down

# Rebuild containers
docker-compose up --build

๐ŸŽฏ Handlers (Controllers)

Generate MVC handlers with actions and optional views:

# Basic handler
coldbox create handler myHandler

# Handler with specific actions
coldbox create handler users index,show,edit,delete

# REST handler
coldbox create handler api/users --rest

# Resourceful handler (full CRUD)
coldbox create handler photos --resource

# Generate with views and tests
coldbox create handler users --views --integrationTests

๐Ÿ“Š Models & Services

Create domain models and business services:

# Basic model
coldbox create model User

# Model with properties and accessors
coldbox create model User properties=fname,lname,email --accessors

# Model with migration
coldbox create model User --migration

# Model with service
coldbox create model User --service

# Model with everything (service, handler, migration, seeder)
coldbox create model User --all

# Standalone service
coldbox create service UserService

๐ŸŽจ Views & Layouts

Generate view templates and layouts:

# Create a view
coldbox create view users/index

# View with helper file
coldbox create view users/show --helper

# View with content
coldbox create view welcome content="<h1>Welcome!</h1>"

# Create layout
coldbox create layout main

# Layout with content
coldbox create layout admin content="<cfoutput>#view()#</cfoutput>"

๐Ÿ”ง Resources & CRUD

Generate complete resourceful components:

# Single resource (handler, model, views, routes)
coldbox create resource photos

# Multiple resources
coldbox create resource photos,users,categories

# Custom handler name
coldbox create resource photos PhotoGallery

# With specific features
coldbox create resource users --tests --migration

๐Ÿ“ฆ Modules

Create reusable ColdBox modules:

# Create module
coldbox create module myModule

# Module with specific features
coldbox create module myModule --models --handlers --views

๐Ÿงช Testing

Generate various types of tests:

# Unit tests
coldbox create unit models.UserTest

# BDD specs
coldbox create bdd UserServiceTest

# Integration tests
coldbox create integration-test handlers.UsersTest

# Model tests
coldbox create model-test User

# Interceptor tests
coldbox create interceptor-test Security --actions=preProcess,postProcess

๐Ÿ—„๏ธ ORM & Database

Work with ORM entities and database operations:

# ORM Entity
coldbox create orm-entity User table=users

# ORM Service
coldbox create orm-service UserService entity=User

# Virtual Entity Service
coldbox create orm-virtual-service UserService

# ORM Event Handler
coldbox create orm-event-handler

# CRUD operations
coldbox create orm-crud User

๐Ÿ”— Interceptors

Create AOP interceptors:

# Basic interceptor
coldbox create interceptor Security

# Interceptor with specific interception points
coldbox create interceptor Logger points=preProcess,postProcess

# With tests
coldbox create interceptor Security --tests

๐Ÿ”„ Development Workflow

Manage your development environment:

# Reinitialize ColdBox framework
coldbox reinit

# Auto-reinit on file changes
coldbox watch-reinit

# Open documentation
coldbox docs
coldbox docs search="event handlers"

# Open API documentation
coldbox apidocs

๐ŸŽ›๏ธ Global Options

Most commands support these common options:

  • --force - Overwrite existing files without prompting
  • --open - Open generated files in your default editor
  • --boxlang - Force BoxLang code generation (usually not needed as it's the default)
  • --cfml - Force CFML code generation (overrides BoxLang default)
  • --help - Show detailed help for any command

Application-Specific Flags

For application creation commands:

  • --migrations - Include database migrations support
  • --docker - Include Docker configuration and containerization
  • --vite - Include Vite frontend asset building (modern/BoxLang templates)
  • --rest - Configure as REST API application (BoxLang templates)

Language Generation Control

The CLI supports both automatic detection and manual override of the target language. BoxLang is now the default language for all new applications and generated code:

  • Default: BoxLang code generation for new applications and components
  • Automatic: Uses detection methods (server engine, box.json settings) for existing projects
  • Force CFML: Use --cfml flag to generate CFML code regardless of detection
  • Force BoxLang: Use --boxlang flag to explicitly generate BoxLang code (usually not needed as it's the default)

๐Ÿ’ก BoxLang Support

The CLI automatically detects BoxLang projects and generates appropriate code. You can also force BoxLang mode using the --boxlang flag.

๐Ÿ” Automatic Detection

The CLI detects BoxLang projects using three methods (in order of precedence):

  1. Server Engine Detection: Running on a BoxLang server
  2. TestBox Runner Setting: When testbox.runner is set to "boxlang" in box.json
  3. Language Property: When language is set to "boxlang" in box.json

โš™๏ธ Configuration Examples

{
    "name": "My BoxLang App",
    "language": "boxlang",
    "testbox": {
        "runner": "/tests/runner.bxm"
    }
}
Method 2: TestBox Runner Setting
{
    "name": "My App",
    "testbox": {
        "runner": "boxlang"
    }
}

๐Ÿš€ Usage Examples

# Default behavior (creates BoxLang code)
coldbox create handler users
coldbox create model User

# Explicit BoxLang generation (usually not needed)
coldbox create handler users --boxlang

# Force CFML generation for legacy projects
coldbox create handler users --cfml
coldbox create app myApp --cfml

๐Ÿ“ Generated Code Differences

When BoxLang mode is detected or forced:

  • Uses .bx file extensions instead of .cfc
  • Generates class syntax instead of component
  • Uses BoxLang-specific template variants
  • Creates BoxLang test files (.bxm extensions)

๐Ÿค– AI Coding Assistance

The CLI now includes Copilot instructions to enhance AI-powered development workflows. These instructions help AI assistants understand ColdBox project structure and generate appropriate code:

Features

  • Intelligent Code Generation: AI assistants can better understand ColdBox conventions and patterns
  • Template-Aware Suggestions: Context-aware code suggestions based on your project type
  • BoxLang & CFML Support: Appropriate suggestions for both language targets
  • Framework Integration: Deep understanding of ColdBox architecture and best practices

Copilot Instructions

The CLI includes specialized instruction sets:

  • Modern Apps: Instructions optimized for contemporary ColdBox applications
  • Legacy Projects: Support for traditional flat-structure applications
  • BoxLang Focus: Enhanced support for BoxLang-specific patterns
  • Framework Patterns: MVC, HMVC, and REST API architectural guidance

These instructions are automatically included in modern application templates to provide the best AI coding experience out of the box.

๐Ÿ“– Getting Help

Every command provides detailed help:

# General help
coldbox help

# Specific command help
coldbox create handler --help
coldbox create model --help

Credits & Contributions

I THANK GOD FOR HIS WISDOM IN THIS PROJECT

The Daily Bread

"I am the way, and the truth, and the life; no one comes to the Father, but by me (JESUS)" Jn 14:1-12

Changelog

All notable changes to this project will be documented in this file.

The format is based on Keep a Changelog, and this project adheres to Semantic Versioning.


Unreleased

8.0.0 - 2025-10-13

7.10.0 - 2025-10-10

Added

  • Forgot to bump it to match ColdBox version.

7.10.0 - 2025-10-10

Added

  • Modules Inherit Entry Point defaults to true now
  • Brand new app-wizard for creating apps interactively
  • fix colors for ps screens
  • BoxLang is now the default engine for new apps
  • Updated all new templates from repos
  • New create app argument for modern or boxlang skeletons: vite to create a Vite enabled app: coldbox create app name="myApp" --vite
  • New create app argument for modern or boxlang skeletons: rest to create a REST enabled app: coldbox create app name="myApp" --rest
    • New create app argument for modern or boxlang skeletons: docker to create a Docker enabled app: coldbox create app name="myApp" --docker
  • New create app argument for modern or boxlang skeletons: migrations to create a Migrations enabled app: coldbox create app name="myApp" --migrations
  • New --cfml argument to create a CFML app: coldbox create app name="myApp" --cfml instead of BoxLang (app is default)
  • BoxLang template skeleton rename
  • Updated docs for BoxLang detection

7.8.0 - 2025-09-29

Added

  • Copilot instructions for AI coding assistance
  • If the skeleton is default and this is a BoxLang project, it will switch the skeleton to BoxLang.
  • added dependabot
  • Moved testbox-cli and commandbox-migrations to dependencies so we can use them in the CLI commands

7.7.0 - 2025-04-29

Fixed

  • More fixes for boxlang arguments

7.6.0 - 2025-04-28

Added

  • New modern template for creating modern apps with the latest features
  • New boxlang template for creating apps with the latest boxlang features
  • Modernization of all templates to use the latest features of ColdBox
  • New --boxlang argument to create content for BoxLang
  • New language argument detection for BoxLang

Changed

  • Updated to the latest Ubuntu images for the GitHub actions

Fixed

  • Fixed resource handler creation.

7.5.0 - 2024-10-16

Fixed

  • watch reinit issues with coldbox watch command
  • key [TEMPLATEPATH] doesn't exist when doing orm operations. This was a typo, it should have been templatesPath

7.4.0 - 2024-03-20

Fixed

  • Create resources missing open param

Added

  • More documentation

7.3.0 - 2024-02-12

Added

  • New github actions
  • Lazy load testbox-cli, commandbox-migrations only when used.

7.2.1 - 2023-05-19

Fixed

  • Fixed coldbox create layout failing due to unescpaed #view()# command

7.2.0 - 2023-05-18

Added

  • New version of CommandBox Migrations
  • Added testbox-cli as a dependency

7.1.0 - 2023-05-18

Added

  • BaseCommand hierarchy for all commands to inherit from
  • New print functions for uniformity of info, warning, success and error messages
  • New coldbox create service command to create services easily
  • Create model with migration now actually generates the property migrations
  • Create coldbox create model --service to create a model with a service
  • Create coldbox create model --all to create a model with a service and all the things

Fixed

  • Version should match major ColdBox version, moved to 7
  • Fixed coldbox create app command to finalize the create app job
  • Set default location to forgeboxStorage for new apps, this was missing
  • coldbox create handler was not creating the views
  • Models isLoaded() was actually wrong
  • Handler test specs carriage returns
  • When creating models with rest or resources, the handler was not being created

1.0.0 - 2023-05-03

Added

  • Migration from CommandBox core to a separate module
  • Updated all templates to ColdBox 7
  • Updated all resources to ColdBox 7 standard code
  • Add --force command to several commands for overwriting files
  • Create app new argument: migrations to init the migrations on the project: coldbox create app name="myApp" --migrations
  • create view command now has an open attribute to open the created views in the editor
  • You can create layouts with content now: create layout name="myLayout" content="my content"
  • You can create views with content now: create view name="myView" content="my content"
  • You can create resourceful handlers: create handler name="myHandler" --resource
  • You can create resourceful rest handlers: create handler name="myHandler" --resource --rest
  • You can create models with migrations now: create model name="myModel" --migration
  • You can create models with seeders now: create model name="myModel" --seeder
  • You can create models with handlers (normal or rest) now: create model name="myModel" --handler or create model name="myModel" --handler --rest
  • You can create models with a resource handler now: create model name="myModel" --resource
  • You can create models will all the things now: create model name="myModel" --all
  • New coldbox docs command to open the ColdBox docs in your browser and search as well: coldbox docs search="event handlers"
  • New coldbox apidocs command to open the ColdBox API Docs in your browser.

Fixed

  • Was resetting the scripts in the templates, which is not needed

Removed

  • Eclipse support

$ box install coldbox-cli

No collaborators yet.
     
  • {{ getFullDate("2023-04-11T19:37:23Z") }}
  • {{ getFullDate("2025-10-13T12:41:05Z") }}
  • 4,034
  • 9,293