ColdBox CLI
The ColdBox CLI is a powerful command-line interface tool that helps you create, manage, and scaffold ColdBox applications and components with ease.
Welcome to the ColdBox CLI - your ultimate command-line companion for rapid ColdBox development! π This powerful tool streamlines the creation, management, and scaffolding of ColdBox applications and components for both CFML and BoxLang projects.
π― BoxLang First: BoxLang is now the default language for all new applications, reflecting the modern direction of ColdBox development.
π¦ CLI Versions & Compatibility
The CLI follows semantic versioning aligned with ColdBox major releases:
ColdBox 8
@8
β Current
box install coldbox-cli@8
ColdBox 6
@6
πΆ Legacy
box install coldbox-cli@6
π‘ Pro Tip: Always use the CLI version that matches your ColdBox framework version for the best compatibility and latest features.
β‘ Quick Installation
Get started in seconds with CommandBox:
# Install the latest ColdBox CLI (v8)
box install coldbox-cli
# Get help anytime
coldbox --helpπ Source Code: Explore the CLI on GitHub at coldbox/coldbox-cli - contributions welcome!
π― Getting Started
The ColdBox CLI supercharges your development workflow with intelligent scaffolding and modern development tools. Whether you're building BoxLang or CFML applications, the CLI has you covered!
π Help is Always Available: Every command supports the
--helpflag for detailed usage information.
π₯ Application Creation
Create stunning ColdBox applications from professionally crafted templates. BoxLang leads the way as the default language for modern development:
ποΈ Application Templates & Features
Choose from various templates and enhance with powerful features:
π§ββοΈ Interactive App Wizard - Perfect for Beginners!
New to ColdBox? The App Wizard is your friendly guide to creating the perfect application setup:
The wizard walks you through every decision with helpful prompts:
π Location
Create in current folder or new directory?
Project organization
π₯ Language
BoxLang (default) or CFML?
Development preference
π― Type
API/REST service or full web app?
Architecture choice
π¨ Frontend
Include Vite for modern UI?
Asset management
π³ Environment
Docker containerization?
Deployment strategy
ποΈ Database
Need migration support?
Data management
Example Wizard Session:
π‘ Pro Tip: The wizard is perfect for exploring all available options and learning about ColdBox features as you create your app!
π Application Templates - Choose Your Foundation
Select from professionally crafted templates or bring your own via ForgeBox ID, GitHub repo, local path, ZIP file, or URL. Our modern templates prioritize BoxLang for cutting-edge development:
π₯ BoxLang Templates (Recommended for Modern Development)
These can be used for BoxLang PRIME projects or CFML projects with the bx-cfml-compat module for compatibility.
boxlang β
Default - Modern ColdBox with latest BoxLang features
New projects, modern architecture
modern
Contemporary app supporting BoxLang + CFML
Hybrid projects, gradual migration
π FLAT CFML Templates (Traditional Development)
Can also be used for BoxLang projects but using the bx-cfml-compat modules to ensure compatibility.
flat
Classic flat-structure ColdBox app
Traditional CFML projects
rest
BoxLang-optimized REST API template
Microservices, API development
rest-hmvc
RESTful app with HMVC architecture
Complex API systems
supersimple
Bare-bones minimal setup
Learning, prototyping
vite
CFML app with Vite integration (legacy)
Legacy frontend modernization
π Enhanced Template Features
Modern templates (boxlang, modern) unlock powerful development features through simple flags:
--vite π¨
Modern frontend with hot reload & optimized builds
Interactive UIs, SPAs
--rest π
REST API configuration with OpenAPI docs
Microservices, APIs
--docker π³
Complete containerization setup
Cloud deployment, consistency
--migrations ποΈ
Database migration system
Data-driven apps
Power Combinations:
β‘ Vite Integration - Modern Frontend Made Easy
Transform your frontend development with Vite's lightning-fast build system and hot module replacement:
π What You Get Out of the Box:
π§ Pre-configured Setup
vite.config.mjs ready to go
Zero configuration needed
π₯ Hot Module Replacement
Instant updates without refresh
Ultra-fast development
π¦ Optimized Builds
Code splitting & tree shaking
Production-ready performance
π¨ Asset Processing
CSS, SCSS, JS, TS support
Modern toolchain
π Dev Server + Proxy
Seamless ColdBox integration
Unified development experience
π Development Workflow:
π‘ Pro Tip: Vite's dev server automatically proxies to your ColdBox application, giving you the best of both worlds!
π³ Docker Integration - Deploy Anywhere, Run Everywhere
Containerize your ColdBox applications for consistent development and bulletproof deployments:
π Complete Container Solution:
π¦ Multi-stage Dockerfile
Optimized for ColdBox apps
Minimal production images
π§ docker-compose.yml
Complete dev environment
One-command setup
ποΈ Database Services
PostgreSQL/MySQL ready
Consistent data layer
β‘ Redis Caching
High-performance caching
Speed & scalability
π Environment Config
Secure variable management
Production-ready security
π Health Checks
Built-in monitoring
Reliable deployments
π Container Commands:
π― Production Ready: The Docker setup includes production optimizations like multi-stage builds, security best practices, and health monitoring!
π― Handlers (Controllers) - Your Application Logic
Generate powerful MVC controllers with intelligent scaffolding for actions, views, and tests:
π Handler Generation Options:
--rest
RESTful endpoints (GET, POST, PUT, DELETE)
API development
--resource
Full CRUD operations
Data management
--views
Corresponding view templates
Full-stack apps
--integrationTests
Test files for actions
Quality assurance
π‘ Smart Generation: The CLI creates handlers in the correct directory structure and generates appropriate code for your project language (BoxLang/CFML)!
π Models & Services - Your Business Logic Powerhouse
Create robust domain models and business services that form the backbone of your application:
π Model Generation Features:
--accessors
Getter/setter methods
Clean property access
--migration
Database table creation
Data persistence
--service
Business logic layer
Complex operations
--all
Complete MVC stack
Full feature development
π‘ Smart Property Generation:
π Pro Tip: Use
--allwhen you need a complete feature with model, service, handler, database migration, and test seeders!
π¨ Views & Layouts - Beautiful User Interfaces
Craft stunning user interfaces with intelligent view and layout generation:
π View Generation Options:
Views
Page content & UI components
Keep focused & reusable
Layouts
Page structure & common elements
Master templates
Helpers
View-specific utility functions
Clean separation of concerns
π‘ Smart Content Generation:
Views are placed in the correct directory structure
Layouts include proper view rendering calls
Helper files provide utility functions for complex views
All generated code follows your project's language (BoxLang/CFML)
π¨ Design Tip: Use layouts for common page structure (header, navigation, footer) and views for specific page content!
π§ Resources & CRUD - Complete Feature Development
Generate complete, production-ready resourceful components with full CRUD operations:
π What Gets Generated:
π― Handler
CRUD actions (index, show, create, edit, delete)
handlers/Photos.cfc
π Model
Data model with validation
models/Photo.cfc
π¨ Views
Complete UI for all actions
views/photos/*.cfm
π£οΈ Routes
RESTful URL patterns
Added to config/Router.cfc
π§ͺ Tests
Unit & integration tests (optional)
tests/specs/
ποΈ Migration
Database table creation (optional)
resources/database/migrations/
π Generated CRUD Actions:
β‘ Instant Productivity: Resources give you a complete feature with working CRUD operations in seconds!
π¦ Modules - Reusable Application Components
Create powerful, self-contained modules that can be shared across applications or published to ForgeBox:
π Module Architecture:
Modules are mini-applications within your ColdBox app, complete with their own:
π Directory Structure - Organized, self-contained file layout
βοΈ ModuleConfig - Independent configuration and settings
π£οΈ Routing - Module-specific URL patterns
π¦ Dependencies - Isolated dependency management
π§ Models & Handlers - Complete MVC architecture (optional)
π¨ Views & Layouts - Independent UI components (optional)
π Modular Power: Modules enable microservice architecture, code reuse, and team collaboration on large applications!
π§ͺ Testing - Quality Assurance Made Easy
Generate comprehensive test suites to ensure your application works flawlessly:
π Testing Types & Their Purpose:
π― Unit
Individual methods & functions
Business logic, utilities
π BDD
Behavior & requirements
User stories, acceptance criteria
π Integration
Component interactions
Workflows, API endpoints
π Model
Data models & validation
Domain logic, persistence
πͺ Interceptor
AOP & cross-cutting concerns
Security, logging, caching
π‘ Testing Best Practices:
Fast Feedback - Unit tests run quickly for immediate validation
Behavior Focus - BDD tests document how features should work
Real Scenarios - Integration tests verify complete user workflows
Data Integrity - Model tests ensure business rules are enforced
π Quality First: Well-tested applications deploy with confidence and maintain themselves over time!
ποΈ ORM & Database
Work with ORM entities and database operations:
π Interceptors
Create AOP interceptors:
π Development Workflow
Manage your development environment:
ποΈ Global Options - Command Superpowers
Enhance any CLI command with these powerful options for a customized experience:
π Universal Command Options
--force β‘
Overwrite existing files without prompting
coldbox create handler Users --force
--open π
Auto-open generated files in your editor
coldbox create model User --open
--help β
Show detailed command help
coldbox create app --help
ποΈ Application Creation Flags
--migrations ποΈ
Database migration system
Data-driven applications
--docker π³
Complete containerization
Cloud deployments, consistency
--vite β‘
Modern frontend asset pipeline
Interactive UIs, SPAs
--rest π
REST API configuration
Microservices, API development
π₯ Language Control
The CLI automatically detects your project language but you can override when needed:
Default π―
BoxLang for new apps, auto-detect for existing
Most scenarios
--boxlang π₯
Force BoxLang generation
Override detection
--cfml π
Force CFML generation
Legacy projects, specific requirements
πͺ Power Combinations:
π‘ 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):
Server Engine Detection: Running on a BoxLang server
TestBox Runner Setting: When
testbox.runneris set to"boxlang"inbox.jsonLanguage Property: When
languageis set to"boxlang"inbox.json
βοΈ Configuration Examples
Method 1: Language Property (Recommended)
Method 2: TestBox Runner Setting
π Usage Examples
π Generated Code Differences
When BoxLang mode is detected or forced:
Uses
.bxfile extensions instead of.cfcGenerates
classsyntax instead ofcomponentUses BoxLang-specific template variants
Creates BoxLang test files (
.bxmextensions)
π€ 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 - Never Get Stuck
The ColdBox CLI has your back with comprehensive help at every level:
π― Quick Help Commands
π When You Need Help
π€ What can I do?
coldbox help
Full command list
π How do I use this command?
coldbox create app --help
Detailed usage & examples
π Something's not working
coldbox --version
Version info for troubleshooting
π‘ Pro Help Tips
Every command has
--help- never hesitate to use it!Help shows examples, options, and flags for each command
When reporting issues, always include your CLI version
The GitHub repository has extensive documentation and examples
π Learning Path: Start with
coldbox create app-wizardto explore all options interactively, then use specific commands as you become more comfortable!
Last updated
Was this helpful?