CommandBox : CLI, Package Manager, REPL & More
6.2.0
6.2.0
  • Introduction
  • About This Book
  • Authors
  • Overview
  • Release History
    • 6.x Versions
      • What's New in 6.0.0
      • What's New in 6.1.0
      • What's New in 6.2.0
    • 5.x Versions
      • What's New in 5.9.1
      • What's New in 5.9.0
      • What's New in 5.8.0
      • What's New in 5.7.0
      • What's New in 5.6.0
      • What's New in 5.5.2
      • What's New in 5.5.1
      • 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
    • Setting Sync
    • Env Var Overrides
  • Embedded Server
    • Multi-Site Support
      • Defining Sites
      • Configuring Sites
      • Servlet Pass Predicate
      • Bindings
      • Multi-Site Examples
      • Pretty Diagrams
    • 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
        • Rewrites Map
        • Custom Predicates/Handlers
        • Rule Examples
        • Debugging Server Rules
      • Bindings
        • Open Browser URL
        • Legacy Port & Host syntax
        • Legacy SSL Server Cert syntax
        • Legacy SSL Client Cert syntax
      • Proxy IP
      • HTTPS Redirect/HSTS
      • SSL Client Certs
      • URL Rewrites
      • Aliases
      • Custom Error Pages
      • MIME Types
      • Welcome Files
      • Custom Java Version
      • Adding Custom Libs
      • GZip Compression
      • REST Servlet
      • Performance Tuning
      • Undertow Options
      • Custom Tray Menus
      • JVM Args
      • Case Sensitivity of Web Server
      • Ad-hoc Env Vars
      • Ad-Hoc Java System Properties
      • server.json Env Var overrides
      • Server Home
      • web.xml Overrides
      • Console Log Layout
      • Resource Manager
      • Adobe CF Features
      • Warmup URLs
      • 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
    • Install Lucee core/lex files
    • WebSocket Support
  • Package Management
    • Installing Packages
      • Installation Path
      • Installation Options
      • Advanced Installation
      • Debug 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
      • Printing Columns
      • Printing Tree
    • 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
    • Installing Lucee Extensions
    • 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
  • Major Areas of Development
  • Featured Enhancements
  • 256 Color support
  • CLI Improvements
  • Shell History
  • CommandBox Bullet Train
  • Interactive Inputs
  • Interactive Jobs
  • Server Logs
  • Access Logs
  • URL Rewrite Logs
  • Automatic Log Rotation
  • Version Checks on Startup
  • Pipe output of native OS binaries
  • Task DSL
  • Actual Proper Non-Sucking Ctrl-C and Ctrl-D support
  • Load ad-hoc jars for Task Runners
  • Task Scaffolding
  • Updated Directory Listing
  • ASCII Art Stereograms
  • Known Breaking Changes
  • Bug
  • Story
  • New Feature
  • Improvement

Was this helpful?

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

What's New in 4.0.0

Major Areas of Development

  • Major rewrite of CLI engine loader

    • Lucee 5 now powers the CLI

    • Using JSR-223 to dynamically load Lucee 5

  • All 3rd Party libs updated

    • JGit

    • Launch4J

    • Runwar

    • JLine3

  • Improved Task Runner support

    • Task scaffolding with “task create”

    • Task DSL to call other tasks

    • Ortus Builds are now being converted to Task Runners. No Ant! No XML!

  • Support for Private package

  • Revamped Server Logs (access, rewrite, console)

  • ColdBox 5 updates

  • Tons of bug fixes and improvements

Featured Enhancements

256 Color support

system-colors

CLI Improvements

Along with the newest version of JLine, there's a ton of nice little things now available in CommandBox 4. The first is a totally revamped tab completion interface. Pressing Tab is now prettier, colored, and more organized. Help is integrated right into the interface, and pressing tab repeatedly will cycle through the available options instead of redrawing the screen over and over.

Next is color coding when you type commands in the shell. This make it much easier to tell when you've typed the name of a command correct and makes the difference between the command and parameters easier on your eyes.

Finally is tab complete and syntax highlighting in the REPL. You can tab complete any CFML function as well as previous variable names you've typed. Common CFML keywords are highlighted, as well as CFML functions and there's even color coded matching of braces, parens, and quotes as you type.

Shell History

There are two new features in the shell's history. Pressing "up" will still show the previous items in your history. But typing a partial command like "cd" and THEN hitting up will jump to the most recent histories that start with that word. Very handy to find that one "coldbox create..." command you ran two days ago.

The second new history feature is known in the bash world as i-search. Press Ctrl-Shift-R to open a search from the console where you can search your entire command history by keyword. Keep pressing Ctrl-Shift-R to cycle backwards through the results. Press Ctrl-Shift-S to cycle forwards through the results. Press enter to run the matched search select, or edit it inline before running it.

CommandBox Bullet Train

There's a new CommandBox module available called "commandbox-bullet-train" which makes the CLI look super sleek and sexy. You can add it very easily with:

install commandbox-bullet-train

You'll want to install a powerline-patched font as well. Check out the instructions under the "Fonts" section in the readme.

And is that some sweet new ASCII art taking advantage of 256 colors as well as a randomized quote/tip on every shell start? Why yes, yes it is!

Interactive Inputs

Interactive Jobs

Some of the more wordy tasks you perform like installing packages and starting servers have gotten a big makeover in how they reveal their output to you. If an installation fails, you want to know about it, but so long as everything worked, you usually don't care. These actions will now scroll the last few active log entries past in a controlled format, but hide them at the end so the shell stays much cleaner, even when installing dozens of packages at once.

As an example, installing CFConfig actually installs 9 separate packages. This used to output around 100 lines of console logging which no one in their right mind ever read. All the same logging is still there, but now by the time it's done, this is all you see:

> install commandbox-cfconfig --force
 ✓ | Installing package [forgebox:commandbox-cfconfig]
   | ✓ | Uninstalling package: commandbox-cfconfig
   | ✓ | Installing package [forgebox:cfconfig-services@be]
   |   | ✓ | Installing package [forgebox:lucee-password-util@^1.0.0]
   |   | ✓ | Installing package [forgebox:adobe-password-util@^1.0.0]
   |   |   | ✓ | Installing package [forgebox:propertyFile@^1.0.0]
   |   | ✓ | Installing package [forgebox:propertyFile@^1.0.7]
   |   | ✓ | Installing package [forgebox:semver@^1.0.0]
   |   | ✓ | Installing package [forgebox:JSONPrettyPrint@^1.2.6]

If you want to troubleshoot, or you are running this install as part of a build and you want to see all this output later, just use the --verbose flag. For server starts, using the --debug flag will preserve all your precious log output on the screen after the server starts.

Even cooler, the Interactive Job interface is fully documented and available for you to use in your Task Runners or Custom Commands.

Docs:

Example:

job.start( 'Starting server' );
  job.addLog( 'This is the server name' );
  job.addWarnLog( 'Hey, don''t touch that dial' );
​
    job.start( 'Installing CF Engine first' );
      job.addLog( 'This was the version used' );
      job.addLog( 'Yeah, we''re done' );
    job.complete();
​
  job.addLog( 'Aaand, we''re back!.' );
  job.addErrorLog( 'I think we''re going to crash' );
​
job.error( 'Didn''t see that coming' );

Which looks like this when it's done:

Server Logs

We did a lot of work to make dealing with servers easier-- especially when it comes to your log files. Console starts and tailing server logs are now color coded so it's easier to find errors and warnings.

We've also fine tuned what information shows up when you do --console starts as well as --debug starts to reduce the noise and enhance the useful information. For instance, when you do:

server start --rewritesEnable --console --debug

You'll see a line of debug logging that shows if the URL rewrites kicked in and what the URL was rewritten to. How useful is that?!

Remember you can view and tail the server "out" logs like so:

server log
server log --follow

Access Logs

The built in Undertow web server that CommandBox uses just got more powerful. You can turn on access logs that show you every incoming HTTP request in the same "common format" as Apache web server.

server set web.accessLogEnable=true

You can view and tail this log file like so:

server log --access
server log --access --follow

URL Rewrite Logs

But wait, there's more logging goodness. Troubleshooting rewrite rules can be really tricky. That's why we broke out a new separate log file just for Tuckey Rewrites to dump into. You can dial in how much information you get with --debug and --trace server starts.

server set web.rewrites.logEnable=true

You can view and tail this log file like so:

server log --rewrites
server log --rewrites --follow

Automatic Log Rotation

CommandBox web servers are truly ready for prime time. All the Undertow log files above automatically rotate which means you'll never fill up a hard drive on accident due to out of control log files.

Version Checks on Startup

Another optional module you can install is the CommandBox update check module. It will check every 24 hours (when starting the shell) and let you know if your CLI or any of your system modules are out of date.

install commandbox-update-check

Pipe output of native OS binaries

This used to work back in the day, but was a regression back when I added the ability to interact with native binaries. Now you have the best of both worlds.

 echo "java -version" | run | #ucase

Task DSL

Running other tasks from inside of Task Runners is now easier. Docs:

Example:

task( 'build' )
    .run();

(Same as running "task run build" from the CLI)

Actual Proper Non-Sucking Ctrl-C and Ctrl-D support

You can now cancel long running commands, tasks, and even HTTP downloads by pressing Ctrl-C. Yay! Pressing Ctrl-C from the prompt does nothing, which is consistent with other shells. Pressing Ctrl-D from the shell will now exit CommandBox entirely which is also consistent with other shells. In case you're wondering, Ctrl-C fires the interrupt terminal signal, and Ctrl-D sends the EOF (end of file) signal.

Docs:

Load ad-hoc jars for Task Runners

You can now load ad-hoc jars right from Task Runners which is sometimes necessary for working with Java libs. Docs:

Examples:

classLoad( 'D:/amqp-client-5.1.2.jar' );
classLoad( 'C:/myLibs,C:/otherLibs' );
classLoad( [ 'C:/myLibs', 'C:/otherLibs' ] );
classLoad( 'C:/myLibs/myLib.jar,C:/otherLibs/other.class' );
classLoad( [ 'C:/myLibs/myLib.jar', 'C:/otherLibs/other.class' ] );

Task Scaffolding

Wanted to play with Task Runners but not sure where you start? Drop everything, grab the closest CommandBox 4 CLI, and run these two commands:

task create --open
task run

You just created a new task and ran it. Go on, look around!

Updated Directory Listing

Directory listings have gotten a makeover. The columns actually align, the file sizes are human-readable, and the file types are color coded. Be careful, you might actually be able to find stuff now!

ASCII Art Stereograms

If you remember the "Magic Eye" books from your childhood, you'll be pleased to know CommandBox has an ASCII Art Stereogram for every day of the month. You'll find it hiding inside the info command. The "image" will change every day at midnight.

    _( )          _( )         _( )          _( )        _( )
  _( )  )_      _( )  )_     _( )  )_      _( )  )_    _( )  )_
 (____(___)    (____(___)   (____(___)    (____(___)  (____(___)
​
​
   /\          /\           /\          /\         /\
  /  \  /\    /  \  /\     /  \  /\    /  \  /\   /  \  /\
 /    \/  \  /    \/  \   /    \/  \  /    \/  \ /    \/  \
           \/          \ /          \/          /          \/
   ..        ..        ..         ..        ..         ..
"        "         "        "         "         "        "
    *       *        *       *        *       *       *       *
  @     @      @     @      @      @     @      @     @     @
 \|/   \|/    \|/   \|/    \|/    \|/   \|/    \|/   \|/   \|/

If you keep looking like that, your face will freeze that way!

Known Breaking Changes

We tried very hard to keep CommandBox 4 compatible but there are a few things that might surprise you.

  • The REPL and Task Runners run against Lucee 5.2.7 instead of 4.5.5. That might affect valid CFML syntax as well as datasource definitions

  • The default server you get when you type "server start" is also Lucee 5.2.7, not Luce 4.5.5.

  • Java 7 support removed. This affects both the core CLI as well as any servers. For CF9 users, you can still run CF9 servers but you'll need to use an older version of Java 8 such as 1.8.0_92. (Note: Java 9 and 10 don't work yet!)

  • Native CFML execution via box foo.cfm now routes through the "execute" command which means no Application.cfc will get run. You can refactor your cfm scripts or use the undocumented _internalRequest() function in Lucee 5.

  • CommandBox 4 is prettier, more productive, and cooler than CommandBox 3. This may cause CLI envy with your Node coworkers. Don't worry, this is normal.

Bug

Story

New Feature

Improvement

PreviousWhat's New in 4.1.0Next3.x Versions

Was this helpful?

There are currently 69 tickets that are part of the 4.0 release. You can view them all over if you filter based on a fixVersion of 4.0.0. Here's an overview of some of the cooler new features, in no particular order.

This is dependant on your terminal, but the CLI now can look a lot prettier. For Mac users, this will probably work out of the box. For Windows users, cmd won't cut it. We recommend checking out as a sweet, tabbed terminal replacement. To see what kind of punch your terminal packs, run this new command:

CommandBox has a new way to interact with users and give them a list of pre-defined options that doesn't require typing a free text response. You'll see it if you try to start the same server twice in a row. This is and available for you to use in Task Runners and custom commands as well.

You no longer can use \t and \n to escape tab and line breaks in command parameters. This caused a lot of confusion in Windows paths and there are other ways to do it right in your terminal. Check out the

The waitForKey() method in Task Runners and custom commands no longer returns the ASCII code, but the actual character pressed OR a special string representing the key press like "key_up" or "key_down". Check out the .

[] - Box CLI not working inside cygwin

[] - Commandbox 3.1.X no longer works with Git Bash

[] - Allow control of default package name when box.json is missing

[] - Server won't start with $ in web root path

[] - Can't list files in directory with parenthesis in the name

[] - Default rewrites don't start regex at the start of the request URI

[] - Ctrl-C in shell kills associated server processes on *nix

[] - Issue installing older CF engine when two versions exist who only differ in build ID

[] - Adobe war has incorrect default /CFIDE CF mapping

[] - CLI Loader crashes: Error reloading cached bundle

[] - ls and dir do not list directory content after 'cd ..' without trailing slash

[] - restart command not correctly detecting stopped server

[] - Starting two servers at once can corrupt servers.json file

[] - Starting server from non-ForgeBox endpoint doesn't detect proper engine/verion

[] - Package publishing fails with folder named "readme" in the root

[] - Control HTTPOnly and secure attribute of JSESSIONID

[] - Version check on startup

[] - CommandBox bullet train

[] - Create a "checkbox" user input for commands

[] - Task DSL

[] - Make SSL work on Adobe servers

[] - Allow testbox run runner to be relative URL

[] - validate box.json properties for testbox run usage

[] - Change default jAnsi temp path

[] - Updating ColdBox commands to ColdBox 5

[] - Enhance REPL console highlighter to work with parens and curlys

[] - Support 256 colors with print helper

[] - Update testbox command to trim and prettify json results

[] - Be able to add jars to core Lucee classloader from inside the CLI

[] - Command to scaffold new task

[] - Create dedicated log for rewrites

[] - Remember the currently edited command when navigating through the history

[] - better tab completion for REPL

[] - Upgrade to JLine3

[] - Update Launch4j library

[] - Refactor `Box foo.cfm` to funnel through execute command

[] - Remove \t and \n escapes

[] - Upgrade CLI core to use Lucee 5

[] - Parsing issue with native OS binaries

[] - Add serverDetails and installDetails to the onServerStart interceptor

[] - Add web access logs to undertow

[] - Improve message on server forget

[] - Don't escape params() in CommandDSL when the command is "run"

[] - Change how Ctrl-C and Ctrl-D behave

[] - Pressing "up" filters history on what you've already typed

[] - Allow Ctrl-C to interrupt executing tasks like downloading a file

[] - REPL isn't clear whether expression returned empty string or null

[] - Allow commands to be interruptible with Ctrl-C

[] - Highlight code in the repl

[] - Add prePrompt interception point

[] - Allow installPath to override PackageDirectory

[] - preProcessLine and postProcessLine interception points

[] - Allow raw params to CommandDSL that aren't escaped

[] - start --console should exit if server is killed externally

[] - Handle download progress when no total file size is avaiable

[] - Switch to load CFML engine via JSR-223

[] - Throw on invalid server.json

[] - Add rewrite exception for Adobe CF's cf_scripts folder

[] - Allow output of native OS binaries to be captured from CLI and task runners

[] - Upgrade to latest JGit lib

[] - PackageDirectory in package box.json is never honored

[] - Improve "testbox run" error output on Adobe CF

[] - Update bundled JRE to latest

[] - Upgrade to WireBox 5.0

[] - Cache CFC metadata for faster startup times

[] - Refresh progress bar UI

[] - UI control for "Jobs" to pare down output for several operations

[] - Spruce up info command with easter eggs

[] - Spruce up dir command

[] - Default to latest in upgrade command when on a prerelease already

[] - Add additional debugging information to the "info" command

in JIRA
ConEMU
https://www.forgebox.io/view/commandbox-bullet-train
fully documented
https://commandbox.ortusbooks.com/task-runners/interactive-jobs
https://commandbox.ortusbooks.com/task-runners/running-other-tasks
https://commandbox.ortusbooks.com/usage/interactive-shell-features#ctrl-c-and-ctrl-d
https://commandbox.ortusbooks.com/task-runners/loading-ad-hoc-jars
https://commandbox.ortusbooks.com/task-runners/task-anatomy
docs on it.
docs here
COMMANDBOX-174
COMMANDBOX-395
COMMANDBOX-728
COMMANDBOX-749
COMMANDBOX-750
COMMANDBOX-761
COMMANDBOX-763
COMMANDBOX-767
COMMANDBOX-778
COMMANDBOX-782
COMMANDBOX-783
COMMANDBOX-785
COMMANDBOX-787
COMMANDBOX-788
COMMANDBOX-790
COMMANDBOX-724
COMMANDBOX-73
COMMANDBOX-566
COMMANDBOX-583
COMMANDBOX-722
COMMANDBOX-725
COMMANDBOX-726
COMMANDBOX-727
COMMANDBOX-729
COMMANDBOX-745
COMMANDBOX-751
COMMANDBOX-752
COMMANDBOX-757
COMMANDBOX-759
COMMANDBOX-760
COMMANDBOX-771
COMMANDBOX-438
COMMANDBOX-482
COMMANDBOX-527
COMMANDBOX-552
COMMANDBOX-596
COMMANDBOX-702
COMMANDBOX-706
COMMANDBOX-714
COMMANDBOX-719
COMMANDBOX-720
COMMANDBOX-730
COMMANDBOX-731
COMMANDBOX-735
COMMANDBOX-736
COMMANDBOX-737
COMMANDBOX-738
COMMANDBOX-739
COMMANDBOX-740
COMMANDBOX-741
COMMANDBOX-742
COMMANDBOX-744
COMMANDBOX-747
COMMANDBOX-753
COMMANDBOX-754
COMMANDBOX-755
COMMANDBOX-756
COMMANDBOX-758
COMMANDBOX-764
COMMANDBOX-765
COMMANDBOX-768
COMMANDBOX-769
COMMANDBOX-770
COMMANDBOX-773
COMMANDBOX-774
COMMANDBOX-775
COMMANDBOX-776
COMMANDBOX-777
COMMANDBOX-780
COMMANDBOX-786
COMMANDBOX-789