BoxLang ๐ A New JVM Dynamic Language Learn More...
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.
Apache License, Version 2.0.
The CLI also matches the major version of ColdBox. If you are using
ColdBox 7, then you should use CLI @7
. This is to ensure
that you are using the correct commands for your version of ColdBox.
Install the commands via CommandBox like so:
box install coldbox-cli
The ColdBox CLI provides powerful scaffolding and development tools
for both CFML and BoxLang
applications. All commands support the --help
flag for
detailed information.
Create new ColdBox applications from various templates:
# Create a basic ColdBox app
coldbox create app myApp
# Create with specific templates
coldbox create app myApp skeleton=modern
coldbox create app myApp skeleton=boxlang
coldbox create app myApp skeleton=rest
coldbox create app myApp skeleton=elixir
# Create with migrations support
coldbox create app myApp --migrations
# Interactive app wizard
coldbox create app-wizard
Available Templates:
default
, boxlang
, modern
,
rest
, elixir
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
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
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>"
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
Create reusable ColdBox modules:
# Create module
coldbox create module myModule
# Module with specific features
coldbox create module myModule --models --handlers --views
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
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
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
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
Most commands support these common options:
--force
- Overwrite existing files--open
- Open generated files in your default editor--boxlang
- Generate BoxLang code instead of CFML--help
- Show detailed help for any commandThe CLI automatically detects BoxLang projects and generates appropriate code. You can also force BoxLang mode:
# Force BoxLang generation
coldbox create handler users --boxlang
# BoxLang project detection based on:
# - Server engine (BoxLang)
# - package.json testbox.runner setting
# - package.json language property
Every command provides detailed help:
# General help
coldbox help
# Specific command help
coldbox create handler --help
coldbox create model --help
I THANK GOD FOR HIS WISDOM IN THIS PROJECT
"I am the way, and the truth, and the life; no one comes to the Father, but by me (JESUS)" Jn 14:1-12
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.
default
and this is a BoxLang project, it will switch the skeleton to BoxLang
.testbox-cli
and commandbox-migrations
to dependencies so we can use them in the CLI commandsboxlang
argumentsmodern
template for creating modern apps with the latest featuresboxlang
template for creating apps with the latest boxlang features--boxlang
argument to create content for BoxLanglanguage
argument detection for BoxLangcoldbox watch
commandtemplatesPath
open
paramtestbox-cli, commandbox-migrations
only when used.coldbox create layout
failing due to unescpaed #view()#
commandtestbox-cli
as a dependencyBaseCommand
hierarchy for all commands to inherit fromcoldbox create service
command to create services easilycoldbox create model --service
to create a model with a servicecoldbox create model --all
to create a model with a service and all the things7
coldbox create app
command to finalize the create app jobforgeboxStorage
for new apps, this was missingcoldbox create handler
was not creating the views
isLoaded()
was actually wrongresources
to ColdBox 7 standard code--force
command to several commands for overwriting filesmigrations
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 editorcreate layout name="myLayout" content="my content"
create view name="myView" content="my content"
create handler name="myHandler" --resource
create handler name="myHandler" --resource --rest
create model name="myModel" --migration
create model name="myModel" --seeder
create model name="myModel" --handler
or create model name="myModel" --handler --rest
create model name="myModel" --resource
create model name="myModel" --all
coldbox docs
command to open the ColdBox docs in your browser and search as well: coldbox docs search="event handlers"
coldbox apidocs
command to open the ColdBox API Docs in your browser.scripts
in the templates, which is not needed
$
box install coldbox-cli