CommandBox : CLI, Package Manager, REPL & More
5.6.0
5.6.0
  • Introduction
  • About This Book
  • Authors
  • Overview
  • Release History
    • 5.x Versions
      • What's New in 5.4.2
      • What's New in 5.4.1
      • What's New in 5.4.0
      • What's New in 5.3.1
      • What's New in 5.3.0
      • What's New in 5.2.1
      • What's New in 5.2.0
      • What's New in 5.1.1
      • What's New in 5.1.0
      • What's New in 5.0.0
    • 4.x Versions
      • What's new in 4.8.0
      • What's New in 4.7.0
      • What's New in 4.6.0
      • What's New in 4.5.0
      • What's New in 4.4.0
      • What's New in 4.3.0
      • What's New in 4.2.0
      • What's New in 4.1.0
      • What's New in 4.0.0
    • 3.x Versions
      • What's New in 3.9.0
      • What's New in 3.8.0
      • What's New in 3.7.0
      • What's New in 3.6.0
      • What's New in 3.5.0
      • What's New in 3.4.0
      • What's New in 3.3.0
      • What's New in 3.2.0
      • What's New in 3.1.1
      • What's New in 3.0.1
      • What's New in 3.0.0
    • 2.x Versions
      • What's New in 2.2.0
      • What's New in 2.1.1
      • What's New in 2.1.0
      • What's New in 2.0.0
    • 1.x Versions
      • What's in 1.0.0
  • Getting Started Guide
  • Setup
    • Requirements
    • Download
    • Installation
    • Light and Thin Binaries
    • Non-Oracle JREs
    • Upgrading
    • Common Errors
  • Usage
    • Execution
      • Recipes
      • CFML Files
        • Using a DB in CFML scripts
      • OS Binaries
      • CFML Functions
      • Exit Codes
    • Commands
    • Parameters
      • Escaping Special Characters
      • File Paths
      • Globbing Patterns
      • Piping into Commands
      • Expressions
    • Command Help
    • Environment Variables
    • System Settings
    • System Setting Expansion Namespaces
    • Ad-hoc Command Aliases
    • Default Command Parameters
    • REPL
    • Tab Completion
    • Interactive Shell Features
    • forEach Command
    • watch Command
    • jq Command
    • printTable Command
    • sql Command
    • Auto Update Checks
    • Bullet Train Prompt
    • 256 Color Support
    • A Little Fun
  • IDE Integrations
    • Sublime Text
    • Visual Studio Code
  • Config Settings
    • Module Settings
    • Proxy Settings
    • Endpoint Settings
    • Server Settings
    • JSON Settings
    • Misc Settings
    • Task Runner Settings
    • Env Var Overrides
  • Embedded Server
    • Multi-Engine Support
    • ModCFML Support
    • Server Versions
    • Start HTML Server
    • Offline Server Starts
    • Debugging Server Starts
    • Server Processes
    • Manage Servers
    • FusionReactor
    • Server Logs
    • Server Scripts
    • Configuring Your Server
      • Security
        • Basic Authentication
        • Client Cert Authentication
      • Server Profiles
      • Server Rules
        • Baked in Rules
        • Allowed Static Files
        • Rule Language
        • Custom Predicates/Handlers
        • Rule Examples
        • Debugging Server Rules
      • Server Port and Host
      • Proxy IP
      • SSL Server Certs
        • SSL Client Certs
      • HTTPS Redirect/HSTS
      • URL Rewrites
      • Aliases
      • Custom Error Pages
      • Welcome Files
      • Custom Java Version
      • Adding Custom Libs
      • GZip Compression
      • REST Servlet
      • Performance Tuning
      • Undertow Options
      • Custom Tray Menus
      • JVM Args
      • Ad-hoc Env Vars
      • Ad-Hoc Java System Properties
      • server.json Env Var overrides
      • Server Home
      • web.xml Overrides
      • Experimental Features
    • External Web Server
    • Starting as a Service
    • Single Server Mode
    • Server.json
      • Working with server.json
      • Packaging Your Server
      • Using Multiple server.json Files
  • Package Management
    • Installing Packages
      • Installation Path
      • Installation Options
      • Advanced Installation
    • Private Packages
    • System Modules
    • Code Endpoints
      • ForgeBox
      • HTTP(S)
      • File
      • Folder
      • Git
      • Java
      • S3
      • CFLib
      • Jar (via HTTP)
      • Lex (via HTTP or File)
      • Gist
    • Package Scripts
    • Dependencies
    • Semantic Versioning
    • Updating Packages
    • Creating Packages
      • Editing Package Properties
      • Publishing Lucee Extensions to ForgeBox
    • Artifacts
    • Box.json
      • Basic Package Data
      • Extended Package Data
      • Package URLs
      • Installation
      • Embedded Server
      • Dependencies
      • TestBox
    • Managing Version
  • Task Runners
    • Task Anatomy
    • BaseTask Super Class
    • Task Target Dependencies
    • Passing Parameters
    • Using Parameters
    • Task Output
      • Printing tables
    • Lifecycle Events
    • Threading/Async
    • Task Interactivity
    • Shell Integration
    • Downloading Files
    • Running Other Commands
    • Error Handling
    • Hitting Your Database
    • Sending E-mail
    • Interactive Jobs
    • Watchers
    • Property Files
    • Running other Tasks
    • Loading Ad hoc Jars
    • Loading Ad-hoc Modules
    • Cancel Long Tasks
    • Progress Bar
    • Caching Task Runners
  • Helpful Commands
    • Token Replacements
    • Checksums
    • Code Quality Tools
    • ask and confirm
  • Deploying CommandBox
    • Github Actions
    • Docker
    • Heroku
    • Amazon Lightsail
  • TestBox Integration
    • Test Runner
    • Test Watcher
  • Developing For CommandBox
    • Modules
      • Installation and Locations
      • Configuration
        • Public Properties
        • Configure() Method
        • Lifecycle Methods
      • Conventions
      • User Settings
      • Linking Modules
    • Commands
      • Aliases
      • Using Parameters
        • Using File Globs
        • Dynamic Parameters
      • Command Output
      • Tab Completion & Help
      • Interactivity
      • Watchers
      • Shell integration
      • Running Other Commands
      • Error handling
      • Watchers
      • Loading Ad hoc Jars
    • Interceptors
      • Core Interception Points
        • CLI Lifecycle
        • Command Execution Lifecycle
        • Module Lifecycle
        • Server Lifecycle
        • Error Handling
        • Package Lifecycle
      • Custom Interception Points
    • Injection DSL
    • Example Project
    • FusionReactor for the CLI
  • ForgeBox Enterprise
    • Introduction
    • Storage
    • Commands
      • List
      • Register
      • Login
      • Set Default
      • Remove
    • Usage
Powered by GitBook
On this page
  • CLI Shell
  • Tail Command
  • Package Management
  • Server Starting
  • Server Welcome Files
  • Better SES URLs
  • Server Configuration
  • Custom Server Home
  • A Few Changes
  • Release Notes
  • Bug
  • New Feature
  • Improvement

Was this helpful?

Edit on GitHub
Export as PDF
  1. Release History
  2. 3.x Versions

What's New in 3.5.0

CLI Shell

We upgraded to a new version of the underlying library that handles the CLI interactions which brought a number of nice things.

  • The cls command now clears background colors that used to be left on the screen

  • Tab completion works better when two folders with different case were in the same directory

  • When developing commands, default text can be placed in the buffer when asking the user for input.

  • Fixed some instances where undesired spaces would get added when hitting tab completion

We also made the following improvements to the CLI shell environment

  • You don't need to escape an equals sign that's part of a quoted parameter value

  • Removed extra line break when piping the output of the "run" command

  • Fixed some regressions when piping text to the box binary

  • Added better BOM detection when tailing files

  • cp command will create destination directories

  • Windows paths that start with \ or / will be treated as absolute (like DOS works)

  • All OS's will expand ~ to the current user's home directory

Tail Command

The tail command used to only take a file as input, but now you can pipe raw text in as well.

CommandBox> forgebox search | tail lines=50

When tailing a file, you can specify the --follow flag and any new text added to the file will live stream to your console until you press Ctrl-C to stop. This is perfect for tailing application logs while your code is running to see new entries.

CommandBox> tail myFile.log --follow
CommandBox> system-log | tail --follow

The server log command also has a new --follow flag added to it which will live stream a running server's console log to the shell until you press Ctrl-C to stop it.

CommandBox> server log --follow

Package Management

The artifact storage location is now customizable thanks to Chris Schmitz, allowing you to store your artifacts on another drive, or even a network share so your coworkers can all use the same "local" copies.

CommandBox> config set artifactsDirectory=/path/to/artifacts

CommandBox will always re-download snapshot versions of packages to make sure you get a fresh version.

CommandBox> install myPackage@1.2.3-snapshot

When you try to install a package and CommandBox is offline, instead of giving up, we'll now look in your local artifacts cache for a satisfying version. If we find a package that works in your artifacts, we'll install it instead.

Server Starting

We added a few new ways to start up a server. You can use the --debug flag when starting a server to see additional information and the foreground process also waits for the server to start before finishing. Now when starting in debug mode this output will stream to the console as it becomes available instead of showing up all at the end. This is great to troubleshoot errors that are happening on server start as well as finding the slow parts of the startup sequence.

CommandBox> server start --debug

By default, your servers fire up in a new process that runs independently from the CLI. There is now a new flag called --console that will start the server up in the foreground and stream the console output to the CLI for you to watch. The start command will not end and will keep streaming the console output until you press Ctrl-C to stop it. You can also use --debug alongside the console flag for even more information.

CommandBox> server start --console
CommandBox> server start --console --debug

Server Welcome Files

If you have an app that uses a default welcome file other than index.cfm, you can control that now.

CommandBox> server set web.welcomeFiles="go.cfm,main.cfm,index.cfm,index.html"

Better SES URLs

This is one that you take for granted if you've always used Adobe ColdFusion, but for any CF server not running on Adobe's custom version of Tomcat, you can't use SES URLs in a subfolder like this without adding custom mappings to your web.xml:

site.com/myFolder/index.cfm/home/login

Server Configuration

All server engines and versions have been standardized to install into the same reliable directory structure to make it easier for you to script config file replacements.

  • For Adobe CF WARs, the xml config files are located in the WAR here: /WEB-INF/cfusion/lib/neo.*.xml

  • For the Lucee server context, the xml config file is located in the WAR here: /WEB-INF/lucee-server/context/lucee-server.xml

  • For the Lucee web context, the xml config file is located in the WAR here: /WEB-INF/lucee-web/lucee-web.xml.cfm

To find the folder where your WEB-INF lives (as well as lots of other information about your server) you can use the server info command to get useful properties about a starting or started server.

# Find the "home" directory for a server (where the WEB-INF lives)
CommandBox> server info property=serverHomeDirectory

# Find the out log file
CommandBox> server info property=consoleLogPath

# Get all possible values as JSON
CommandBox> server info --JSON
CommandBox> cp neo-datasource.xml '`server info property=serverHomeDirectory`/WEB-INF/cfusion/lib/neo-datasource.xml'

Read more about this here:

Custom Server Home

  • Customize Lucee's server context folder with the serverConfigDir setting

  • Customize Lucee's web context folder with the webConfigDir setting

  • Customize where the entire WAR explodes to for any server with the serverHomeDirectory setting

This is very powerful since it gives you full control over the server deployment. Server installs have also been changed to NOT overwrite existing files when they unzip, so any config files you place in the server home prior to starting the server will be left in place and used by the server when it starts up. This means you can have datasources, mappings, and more start out-of-the-box for your site on a fresh install.

Read more about this here.

A Few Changes

There were a few small changes in the "undocumented" core of CommandBox that got rearranged to make more sense. There's a small chance you may have been relying on one of them, so take note:

  • The serverHome property that comes back from server info has been renamed to serverHomeDirectory.

  • The webConfigDir property used to point to the server home, but this was incorrect. The property will now be blank unless specified. Use serverHomeDirectory instead.

  • The default Lucee server used to have a non-standard folder structure, but now matches the WAR folders of all other servers

  • The web context in Lucee servers used to be in a folder named after a random hash which was kind of silly (and impossible to find). It's now always under /WEB-INF/lucee-web

  • All "internal" Lucee servers used to share a single server context (and settings). All servers are now separate. Use the serverConfigDir setting to point more than one server at a single server context or use one of the new options for copying configs.

  • The core CLI server context now has a default password of "commandbox" set. This would apply if you wanted to use the tag from .cfm files executed via the shell or a custom command.

  • Several new properties were added to the server info data for your convenience. Check them out by starting a server and running server info --JSON.

Release Notes

Bug

New Feature

Improvement

PreviousWhat's New in 3.6.0NextWhat's New in 3.4.0

Last updated 2 years ago

Was this helpful?

We've added just a dash of servlet fairy dust that now makes this possible. Note, if you want to hide the index.cfm with URL rewrites, you'll need a for it to work in a subfolder.

Combining these allows you to do some nice one-liners like scripting out the copying of config settings when the server starts up. Hint: !

Until now you've had to live with the special directory that CommandBox uses to install your servers into. Now you can get full control over where the server goes which is perfect for creating a folder "seeded" with config files that you want the server to use when it first starts. This trick (with some ) will also allow you to commit changes to your config files back to the repo while ignoring the rest of the engine.

[] - `box reload` doesn't clear background colors from buffer on Windows

[] - tab completion doesn't always work on paths

[] - CommandBox timeout is shorter than runwar timeout when starting Adobe servers

[] - BOM interferes with commandbox.properties

[] - Staring server with defautlPort in box.json, adds optional keys back in.

[] - Ignore equals in a quoted parameter

[] - Improve error message when endpoint fails installing server

[] - Use hostname for "coldbox reinit"

[] - Error starting CommandBox in some instances

[] - "run" expressions contain line break on Linux

[] - Regression in piping input from OS console

[] - Piping a file of commands with a BOM into box fails

[] - package set doesn't always set what you expect

[] - The `commandbox-home` when used in symbolic link mode fails on mac

[] - ability for server start to deploy web-inf locally instead of server location

[] - Control list of welcome files

[] - Make artifacts path customizable

[] - Allow tail command to follow a log file

[] - Allow raw text to be piped into the tail command

[] - Add startTimeout parameter to control how long to wait for server to start

[] - Console flag to server start

[] - new preServerStart interceptor

[] - Add --follow flag to "server log" to tail it and follow

[] - cp command create directories if necessary when copying file

[] - If Forgebox is down, use artifacts cache on installs

[] - Allow programmatic access to server info

[] - Allow custom server home dir

[] - Support for double wildcard servlet mappings

[] - Set default password Lucee CLI context

[] - absolute paths on Windows don't follow the same rules as DOS

[] - If forgebox is down, 'internal' server won't start

[] - Upgrade engine to Lucee 4.5.4.017

[] - improve contentbox-widget package installation conventions

[] - Stream server start log when debug is true

[] - Improve JSON parsing when piping complex values to cfml command

[] - Allow webConfigDir, serverConfigDir & webXML to be relative

[] - Improve rewrites to not fire on SES URLs in a subdir

[] - server forget does not stop server if running

[] - libdirs aren't relative when starting a server

[] - Libdirs aren't used for non-internal servers.

[] - Improve output of server info and server list commands

[] - Stop loading java agent for Lucee 5

[] - Improve starting internal server when not specifying buildID

[] - Improve server start intercepors

[] - Standardize server home directories

[] - Upgrade to JLine 2.15-snapshot

[] - Allow default text to be put in buffer for ask() function

[] - Don't cache snapshots

[] - Remove .git folder when cloning a Git repo

[] - Support ~ as a shortcut for the user home directory like bash.

[] - Improve tab completion for server/package/config set commands

[] - Spruce up the opening ASCII art

[] - Pass JVM args through to background server process

[] - Fix working directory of xxxInstall package scripts

custom rewrite config
Use an onServerInstall or onServerStart package script
https://commandbox.ortusbooks.com/content/v/development/embedded_server/copy-configs.html
clever Git ignores
https://commandbox.ortusbooks.com/content/v/development/embedded_server/custom-server-home.html
COMMANDBOX-236
COMMANDBOX-248
COMMANDBOX-500
COMMANDBOX-505
COMMANDBOX-507
COMMANDBOX-509
COMMANDBOX-522
COMMANDBOX-526
COMMANDBOX-533
COMMANDBOX-539
COMMANDBOX-542
COMMANDBOX-543
COMMANDBOX-544
COMMANDBOX-545
COMMANDBOX-234
COMMANDBOX-473
COMMANDBOX-479
COMMANDBOX-503
COMMANDBOX-504
COMMANDBOX-506
COMMANDBOX-508
COMMANDBOX-523
COMMANDBOX-534
COMMANDBOX-535
COMMANDBOX-536
COMMANDBOX-538
COMMANDBOX-546
COMMANDBOX-153
COMMANDBOX-222
COMMANDBOX-439
COMMANDBOX-456
COMMANDBOX-498
COMMANDBOX-499
COMMANDBOX-501
COMMANDBOX-510
COMMANDBOX-511
COMMANDBOX-514
COMMANDBOX-515
COMMANDBOX-518
COMMANDBOX-519
COMMANDBOX-520
COMMANDBOX-521
COMMANDBOX-524
COMMANDBOX-528
COMMANDBOX-529
COMMANDBOX-530
COMMANDBOX-531
COMMANDBOX-532
COMMANDBOX-537
COMMANDBOX-540
COMMANDBOX-547
COMMANDBOX-549
COMMANDBOX-550
COMMANDBOX-551