Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
The main features of CommandBox 4.5.0 are:
Ability to install OpenJDK automatically for your servers to use (read more)
Environment Variables in the shell (read more)
Support for Forgebox Enterprise (TBA soon)
JRE Bundled CommandBox installs now use OpenJDK instead of Oracle JDK
TestBox Code Coverage integration (read more)
I already wrote a fairly comprehensive overview of the new features and big fixes here. Go read it:
https://www.ortussolutions.com/blog/commandbox-450-rc-release-candidate-ready-for-testing
Note, there are two backwards incompatible changes. The first is we turned OFF directory browsing by default on servers. You can easily get the old behavior back with
The second is that unhandled errors in the shell no longer show the stack trace (you probably wouldn't have noticed if I didn't tell you!) Get the old behavior back with:
Here's the full list of everything that went into this release.
[COMMANDBOX-784] - editing in the shell prompt is buggy while using Gitbash in VSCode
[COMMANDBOX-895] - Passing positional args to task errors with required param
[COMMANDBOX-897] - Passing command string as single arg to box fails
[COMMANDBOX-899] - Exitting recipe with exit code errors
[COMMANDBOX-901] - external module mappings broken in CommandBox 4
[COMMANDBOX-903] - Incorrect behavior when parsing unmatched quotes
[COMMANDBOX-915] - Cruft left in temp folder
[COMMANDBOX-917] - Silence annoying ESAPI warnings
[COMMANDBOX-919] - Warnings on java 11 about illegal reflective access
[COMMANDBOX-516] - Add concept of env vars for commands to use
[COMMANDBOX-906] - Add preCommandParamProcess interception point
[COMMANDBOX-907] - outdated commands now verify packages in parallel
[COMMANDBOX-908] - Automatically download JRE for server if specified by version range
[COMMANDBOX-910] - Support multiple ForgeBox endpoints
[COMMANDBOX-911] - New Java endpoint that ties into the AdpotOpenJDK builds
[COMMANDBOX-914] - Make exit code of native binary from run command available in the exception that is thrown
[COMMANDBOX-916] - Pull Code Coverage data on "testbox run"
[COMMANDBOX-921] - Allow recipe args to be used as environment variables for that command
[COMMANDBOX-896] - Add ETA to progress bar when downloading
[COMMANDBOX-898] - Improve default handling of JVM heap size
[COMMANDBOX-900] - Default directoryBrowsing to false
[COMMANDBOX-902] - Allow box to be called with a single string containing a command chain
[COMMANDBOX-904] - Prevent folder endpoint from picking up folders in CWD on install
[COMMANDBOX-909] - Hide stack trace by default when CLI errors
[COMMANDBOX-922] - Allow recipe command to accept arbitrary commands directly
[COMMANDBOX-923] - Include mapping-tag in rewrite exclusion list
[COMMANDBOX-924] - Update JRE builds to use OpenJDK instead of Oracle JDK
[COMMANDBOX-925] - Provide all other args to command completor UDFs
[COMMANDBOX-926] - Announce postInstall interceptions even if package was found to be already installed
Here's the full list of what we've packed into the 4.7.0 release. Click any ticket link for more details.
[COMMANDBOX-962] - CommandBox not recognizing implicit folder endpoint
[COMMANDBOX-967] - Update semver for fix in prerelease comparison
[COMMANDBOX-970] - Tokenizer breaks "run" command with odd syntax
[COMMANDBOX-972] - init-wizard command is incorrectly aliasing as init
[COMMANDBOX-978] - File watcher that modifies the file system triggers the watcher again
[COMMANDBOX-985] - bump command doesn't work on a submodule
[COMMANDBOX-986] - Text on standard input causes banner and prompt to be blank
[COMMANDBOX-988] - Inconsistent behavior of "run" command.
[COMMANDBOX-989] - Tab completion incorrect for some partial command names
[COMMANDBOX-990] - Interactive jobs are not thread safe
[COMMANDBOX-956] - Leading zeros in semver prevent them from being matched
[COMMANDBOX-957] - Allow --verbose flag on uninstall command
[COMMANDBOX-958] - Add --roundup flag to indents command
[COMMANDBOX-959] - JSON Schema for box.json
[COMMANDBOX-968] - Update JGit to 5.3.0.201903130848-r
[COMMANDBOX-969] - Update Jline to 3.10.0
[COMMANDBOX-971] - Remove Riaforge endpoint Rince riaforge is dead
[COMMANDBOX-973] - Modify default box.json from "init" command
[COMMANDBOX-974] - Add box: namespace for compat with Coldbox injection DSL
[COMMANDBOX-976] - Improve debugging and error messages for custom ForgeBox endpoints
[COMMANDBOX-979] - If the test runner produces a 500 exception during watcher no output is shown
[COMMANDBOX-982] - support for Environment variables in "Key" names
[COMMANDBOX-983] - Make env vars in CommandBox visible to native OS binaries
[COMMANDBOX-984] - Launching VSCode from ConEMU screws up the integrated terminal
[COMMANDBOX-987] - Keep relative installPaths in box.json
For a task that has more than one target (method) you can specify dependencies that will run, in the order specified, prior to your final target. Specify task target dependencies as a comma-delimited list in a depends
annotation on the target function itself. There is no limit to how many target dependencies you can have, nor how deep they can nest.
Given the above Task Runner, typing
would run the runMeFirst()
and run()
method in that order.
Docs:
https://commandbox.ortusbooks.com/task-runners/task-target-dependencies
The web server in CommandBox is capable of enabling GZIp compression to reduce the size of HTTP responses. To enable GZip compress on your CommandBox server, add a web.gzipEnable
setting in your server.json
file.
Docs: https://commandbox.ortusbooks.com/embedded-server/configuring-your-server/gzip-compression
When you get a directory listing in CommandBox, you can add the --simple flag which will only output the file and folder name without any other information. This feature was added to compliment the feature below.
The foreach
command will execute another command against every item in an incoming list. The list can be passed directly or piped into this command. The default delimiter is a new line so this works great piping the output of file listings directly in, which have a file name per line.
This example will find all JSON files in a directory and run the cat command against them.
Docs: https://commandbox.ortusbooks.com/usage/foreach-command
This is still a little experimental since it hasn't gone through full testing, but we upgraded to Lucee 5.2.9.31 in the core CLI which has support for the newer versions of Java. We've removed the checks that previously preventing CommandBox from even trying to run on versions of Java later than 8 and at first glance it seems to be working though there's been some flakiness on Java 11. Please help test these later Java versions and remember that if you spin up a server, you'll want to still dial in Java 8 for Adobe CF 2016 and prior and Lucee 5.2.8.50 and prior even if you have the CLI running on Java 9+.
Docs for setting custom Java version in your server:
https://commandbox.ortusbooks.com/embedded-server/configuring-your-server/custom-java-version
Here's the full release notes for CommandBox 4.3.0.
[COMMANDBOX-692] - Command Box failed to initialize using java 9
[COMMANDBOX-845] - CFFileServlet doesn't work with default rewrites in ACF 2016
[COMMANDBOX-849] - We need to review exit codes in Tasks
[COMMANDBOX-856] - WireBox/LogBox upgrade broke system logging
[COMMANDBOX-857] - Engine name not detected correctly when using HTTP URL for cfengine
[COMMANDBOX-860] - Fix annoying web-inf folder for Flex logs on Adobe engines
[COMMANDBOX-861] - Missing line break when following log file
[COMMANDBOX-865] - Spelling error in info message for accessLogEnable
[COMMANDBOX-867] - coldbox create app cuts last char from package name
[COMMANDBOX-869] - Starting Adobe server errors when no CFIDE mapping is defined
[COMMANDBOX-871] - CommandDSL parsing doesn't handle quoted text in command
[COMMANDBOX-848] - Task method dependencies
[COMMANDBOX-852] - Add setting for GZip compression
[COMMANDBOX-858] - Add --simple flag to ls/dir command to only output filename
[COMMANDBOX-859] - Add "forEach" command to execute command once per incoming line
[COMMANDBOX-824] - TestBox Run command could use a way to add custom url parameters. Also the options parameter does nothing
[COMMANDBOX-846] - Improve progress bar cleanup and exit codes on Ctrl-C
[COMMANDBOX-851] - Allow Java jars to be installed from S3
[COMMANDBOX-854] - JSON Schema for server.json
[COMMANDBOX-863] - Upgrade CLI to Lucee 5.2.9.31
[COMMANDBOX-864] - Support sorting JSON objects by key when formatting
[COMMANDBOX-866] - Task DSL assume CWD of task file
[COMMANDBOX-868] - coldbox scaffold install testbox by default
[COMMANDBOX-870] - Allow command DSL params() to be called more than once
[COMMANDBOX-872] - Make resolvePath() in Base command/task
[COMMANDBOX-873] - Reload shell doesn't always fire when non-CommandBox modules get updated in core
[COMMANDBOX-874] - Allow print helper to accept complex objects and serialize them for output.
In this section you will find the release notes for the 4.x version of CommandBox.
Version 4.8.0 - Sept 2019
Version 4.7.0 - June 2019
Version 4.6.0 - Mar 2019
Version 4.5.0 - Dec 2018
Version 4.4.0 - Nov 2018
Version 4.3.0 - Oct 2018
Version 4.2.0 - Aug 2018
Version 4.1.0 - Jun 2018
Version 4.0.0 - Jun 2018
[COMMANDBOX-934] - Server commands can have huge delay on Windows
[COMMANDBOX-937] - List artifacts alphabetically.
[COMMANDBOX-939] - /usr/bin/open on Linux
[COMMANDBOX-942] - Errors in command CFCs can cause box to exit completely during tab complete
[COMMANDBOX-949] - Running native binary that returns lots of text can perform poorly
[COMMANDBOX-950] - Interceptor service blows up if you register a module with an interceptor not matching any current states
[COMMANDBOX-951] - Allow modules to register an interceptor with no currently valid states
[COMMANDBOX-953] - Catch errors from desktop.isDesktopSupported()
[COMMANDBOX-930] - Allow system setting (env var) expansions in REPL
[COMMANDBOX-932] - Improve task DSL to allow access to exit code
[COMMANDBOX-944] - Add config setting to debug raw native command being used in the "run" command
[COMMANDBOX-249] - Enforce correct casing conventions on scaffolding commands
[COMMANDBOX-927] - Update propertyFile core module
[COMMANDBOX-928] - Improve default ignores in box.json from init command.
[COMMANDBOX-929] - Disable ping to time server host by default
[COMMANDBOX-931] - Allow exit code to be returned via "return" keyword
[COMMANDBOX-935] - Improve syntax highlighting in REPL
[COMMANDBOX-938] - Checking interrupted status from inside a thread doesn't end the task/command
[COMMANDBOX-943] - Remove hint from default CFC in Lucee for CommandBox CFCs with no hint of their own
[COMMANDBOX-945] - Endpoint URL shows incorrectly for forgebox endpoints
[COMMANDBOX-948] - Enhance tab complete for private slugs
You can now cache downloads using the HTTP(S) endpoints using the following syntaxes:
This will speed up builds.
Thanks to a pull request from John Berquist, we've borrowed a Bash and Powershell feature of being able to change back to your previous working directory by typing this:
Thanks to more pull requests from John Berquist, you can use file and folder based tab completion when typing native binaries from CommandBox
And tab completion also works better now when typing a quoted string such as a file path that contains a space. This is a huge timesaver!
Package scripts that are fired from internal interception points, can access any intercept data via environment variables. This example writes a file into a server home directory when the server starts, using an environment variable to dynamically find the correct path.
Here are the full release notes for CommandBox 4.8.0:
[COMMANDBOX-991] - Can't always install modules - git error: Directory already exists
[COMMANDBOX-994] - regex metachars not escaped properly in first token of run command
[COMMANDBOX-998] - testbox watch command doesn't obey verbose flag in box.json
[COMMANDBOX-999] - Sometimes line breaks leak to console when using expansions
[COMMANDBOX-1000] - Pass ad-hoc parameters to package scripts
[COMMANDBOX-1003] - Servers bound to 0.0.0.0 don't open useful browser URL
[COMMANDBOX-1030] - unicode chars not read from readme files when publishing
[COMMANDBOX-1040] - Native OS execution doesn't handle exit on fail for *nix
[COMMANDBOX-1041] - Install path not respected when createPackageDirectory set to false
[COMMANDBOX-1002] - Add cached version of HTTP(S) endpoints
[COMMANDBOX-1031] - Output binary objects in REPL
[COMMANDBOX-1039] - Add support for "cd -"
[COMMANDBOX-993] - Announce onServerStop when stopping a --console server
[COMMANDBOX-996] - Support path completion with "run" or "!" command
[COMMANDBOX-997] - Expand log output of failed job steps
[COMMANDBOX-1001] - Pass interceptData to package scripts
[COMMANDBOX-1004] - Allow tab completion on quoted parameters
[COMMANDBOX-1033] - Editor on Linux
[COMMANDBOX-1042] - Return actual exit code of server process from server start
[COMMANDBOX-1045] - Java install endpoint allows invalid slugs
[COMMANDBOX-1046] - Pass CommandBox shell env vars to server starts
[COMMANDBOX-1047] - Better detection of CF Engine when using HTTP provider
Fixed the annoying "server spanner" error that *nix users saw when starting servers.
Updated CLI engine (and default server) version to Lucee 5.2.7.63 which includes an important security fix.
Added a new "noninteractive" setting to improve the output on build servers like Jenkins or Travis-CI
Task runner metadata changes picked up without needing to reload the CLI
Ability to load ad-hoc modules on the fly from Task Runners
Here's the full list of tickets we addressed in the 4.1.0 release. Thanks to those who send me pull requests for some of these fixes and features!
[COMMANDBOX-791] - server start on linux: "/bin/bash not found" message displays
[COMMANDBOX-799] - Improve port binding logic
[COMMANDBOX-802] - Task component metadata is not refreshed before each run
[COMMANDBOX-806] - Error when invalid UTF-8 characters are in servers.json
[COMMANDBOX-669] - Localized CommandBox Modules
[COMMANDBOX-793] - Add new slugify function to the formatter utility
[COMMANDBOX-794] - When creating coldbox skeleton apps, clear out the basic name, slug, version, location and scripts so the user can configure them
[COMMANDBOX-797] - Added new bundles,labels,verbose,directory arguments to the testbox watch command to allow for granular executions
[COMMANDBOX-798] - Added verbose options to passthrough to the testbox runner so it true it can return the debug buffer
[COMMANDBOX-792] - Remove legacy installColdbox, installColdboxBE, installTestbox arguments from create commands
[COMMANDBOX-796] - Added ability to visualize the exception stacktraces with a configurable depth.
[COMMANDBOX-800] - Add setting to force "non interactive" shell that disables fancypants progress output
[COMMANDBOX-803] - Change user agent on downloader to get around proxies like cloudflare
[COMMANDBOX-804] - Store less "result" text in CommandBox's servers.json
[COMMANDBOX-807] - Upgrade core Lucee engine to 5.2.7.63
In no particular order...
Fix background colors not showing up in Powershell and Windows cmd
System Setting expansions not always working in server.json
testbox run no longer blindly assumes you're returning JSON.
Piping commands into box was broken since 4.0.0
Starting server with --debug didn't output logs on error.
Sorted by createUUID() DESC...
Custom commands have more control over their tab completion candidates. Docs Here
Control how many levels deep package list displays
New versions of Lucee, JGit, JLine, and WireBox
More pack200 of the Lucee jar (and more improvements to come soon in the next version of Lucee)
Automatic detection for build servers like Travis-CI to hide progress bar animations. Docs Here
Cloning Git repos during install has a nice new progress bar that plays well with interactive jobs
You can use the aforementioned progress bar for your own purposes in custom commands and Task Runners. Docs Here
The run command has been a pain over the last few versions as every "fix" has seemed to lead to another regression. We've made some more changes to try and get each use case working as expected with no annoying bash messages about "job control". Fingers crossed.
Single one-off command, streams output to console as it comes.
Piping output of native binary into another Command (output captured all together and not streamed).
Running interactive commands. No output at all really, standard input and output of CommandBox bound directly to native shell
You can now control the exit code that CommandBox (or your recipe) exits with. Remember, zero is successful, any other number is failure.
Access the Exit Code of the previous command via a System Setting expansion of**${exitCode}**.
Recipes now have better support for exit codes. If a command throws an error OR returns a non-zero exit code, the recipe will stop and the exit code of the last command will be returned as the exit code from the recipe command. And if it was a non-interactive shell, the exit code will flow all the way back to the operating system from the box binary. Also, running "exit" inside of a recipe will no longer exit the entire shell, but just that recipe execution. This give you a lot better control over your recipes.
https://commandbox.ortusbooks.com/usage/execution/exit-codes
Let's take a moment to review an existing but little known feature of CommandBox that we borrowed from bash. This is not new, but you need to know this for the following section to make any sense. Similar to bash, CommandBox allows you to chain multiple commands together on the same line and make them conditional on whether the previous command was successful or not.
You can use &&
to run the second command only if the previous one succeeded.
You can use ||
to run the second command only if the previous one failed.
You can use a single semicolon (;
) to separate commands and each command will run regardless of the success or failure of the previous command.
With the above building blocks, we can get clever to create simple conditionals to only run commands if a condition is met. Or these can simply be used to cause recipes to stop execution or to fail builds based on a condition. The following commands output nothing, but they return an appropriate exit code based on their inputs.
https://commandbox.ortusbooks.com/usage/execution/exit-codes#assertions
Returns a passing (0) or failing (1) exit code whether the path exists.
You can specify if the path needs to be a file or a folder.
Returns a passing (0) or failing (1) exit code whether truthy parameter passed. Truthy values are "yes", "true" and positive integers. All other values are considered falsy
Returns a passing (0) or failing (1) exit code whether both parameters match. Comparison is case insensitive.
Big thanks to John Berquist and Dominic Watson for helping add this new feature. You can now install packages directly from S3, Amazon S3, Digital Ocean Spaces and Google Disk.
There are several different authentications mechanisms available too:
Per bucket credentials in your CommandBox endpoint settings
Global credentials in your CommandBox endpoint settings
Environment variables
AWS credentials file
IAM role
The full docs are here:
https://commandbox.ortusbooks.com/package-management/code-endpoints/s3
We've added 17 pieces of flair to our server tray menus to show you more information such as PID, webroot, and port as well as a new option to open up the web root in your file system explorer.
Here's the full list of everything that changed in CommandBox 4.2.0.
[COMMANDBOX-417] - .zip files in artifacts cache don't include empty folders
[COMMANDBOX-808] - "bash: no job control in this shell" error message (pull request)
[COMMANDBOX-809] - external commands/shells that are interactive (such as vi) are not working when executed from commandBox
[COMMANDBOX-810] - tab hinting colors wrong in PowerShell terminals.
[COMMANDBOX-811] - System settings not always used in server.json
[COMMANDBOX-829] - "testbox run" formats outputfile as JSON even if it's not
[COMMANDBOX-833] - Piping input to CommandBox broken
[COMMANDBOX-834] - Bleeding edge upgrades show wrong URL after S3 artifacts move
[COMMANDBOX-835] - --debug doesn't dump job logs on error
[COMMANDBOX-814] - Allow arbitrary command params to have file/folder completion via annotation
[COMMANDBOX-815] - Allow custom completion UDFs to provide group and description
[COMMANDBOX-839] - New conditional commands pathExists, assertTrue and assertEqual
[COMMANDBOX-840] - Allow access to previous exitCode as system setting
[COMMANDBOX-841] - Allow user to exit shell with specific exit code
[COMMANDBOX-842] - Improve recipe handling of exitCodes
[COMMANDBOX-746] - Compact package listing
[COMMANDBOX-779] - Write a custom JGit progress updater that clears out at the end
[COMMANDBOX-813] - Hide JLine warning about dumb terminals
[COMMANDBOX-817] - S3 Endpoint
[COMMANDBOX-818] - Upgrade to JGit 5.0.1
[COMMANDBOX-819] - Upgrade to Launch4J 3.12
[COMMANDBOX-820] - Skip forgebox checks on server start with server home dir that's already installed.
[COMMANDBOX-821] - Upgrade to JLine 3.8.2
[COMMANDBOX-823] - Pack200 Lucee bundles
[COMMANDBOX-825] - Upgrade to Lucee 5.2.8.50
[COMMANDBOX-826] - Default rewrites support /pms servlet used for Adobe CF 2018 performance monitor
[COMMANDBOX-827] - Default nonInteractiveShell setting in commonly known build environments
[COMMANDBOX-828] - Improve messaging when initting private package
[COMMANDBOX-837] - Reorganize the tray menus
[COMMANDBOX-843] - Upgrade to Wirebox 5.1
The foreach command which was introduced recently and allows you to iterate over any list of input and run a command using each item in the list has been enhanced to also allow you to iterate from the CLI over any JSON string that you pipe in.
https://commandbox.ortusbooks.com/usage/foreach-command#iterating-over-json
Now when you create a directory watcher in a task runner or custom command, you can not only get notified when something in that directory changes, but you also now receive a list of files added, removed, and modified.
Thanks to Scott Steinbeck, we have a new command called coldbox watch-reinit. This will watch for changes to certain files in your project and will automatically issue a framework reinit when you edit things like configs or services.
Thanks to John Berquist, CommandBox now has sweet color coding any time it outputs JSON to the screen. Try it out by running something like "server show".
Users can also customize the colors they see for JSON with the following config settings:
json.ansiColors.constant
json.ansiColors.key
json.ansiColors.number
json.ansiColors.string
Setting values can be any color name from the system-colors command.
Thanks to Jason Steinshouer we have a new Gist endpoint for installing code from a public Gist.
https://commandbox.ortusbooks.com/package-management/code-endpoints/gist
[COMMANDBOX-876] - testbox watcher shows error when test fail
[COMMANDBOX-881] - Tab complete doesn't work on param values with spaces
[COMMANDBOX-882] - Long lines wrap in interactive jobs
[COMMANDBOX-887] - Exact versions don't update from ForgeBox when manually changed.
[COMMANDBOX-895] - Passing positional args to task errors with required param
[COMMANDBOX-877] - Allow watcher access to files that were added, removed, updated
[COMMANDBOX-878] - coldbox watch-reinit command
[COMMANDBOX-879] - Color code JSON on console output by default
[COMMANDBOX-698] - Refresh any salt values when deploying a new CF engine.
[COMMANDBOX-732] - Add Gist endpoint
[COMMANDBOX-880] - Change update behavior of GIT and URL endpoints to use semver in path if present
[COMMANDBOX-883] - Enhance foreach command to accept JSON
[COMMANDBOX-884] - ACF 11 should start without Secure Profile
[COMMANDBOX-890] - Enhance "forgebox search" command to break up versions like "forgebox show"
[COMMANDBOX-891] - Support versions like 0.5.2 in forgebox show/search output
[COMMANDBOX-892] - Speed up embedded server start
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
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.
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.
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:
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!
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:
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:
Which looks like this when it's done:
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:
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:
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.
You can view and tail this log file like so:
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.
You can view and tail this log file like so:
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.
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.
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.
Running other tasks from inside of Task Runners is now easier. Docs:
Example:
(Same as running "task run build" from the CLI)
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:
You can now load ad-hoc jars right from Task Runners which is sometimes necessary for working with Java libs. Docs:
Examples:
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:
You just created a new task and ran it. Go on, look around!
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!
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!
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.
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 and 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