Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Welcome to the CommandBox Manual. CommandBox is a standalone, native tool for Windows, Mac, and Linux that will provide you with a Command Line Interface (CLI) for developer productivity, tool interaction, package management, embedded CFML server, application scaffolding, and sweet ASCII art. It seamlessly integrates to work with any of Ortus Solutions *Box products, but it is also open for extensibility for any ColdFusion (CFML) project as it is written in ColdFusion (CFML) using our concepts of CommandBox Commands.
CommandBox is maintained under the Semantic Versioning guidelines as much as possible. Releases will be numbered with the following format:
And constructed with the following guidelines:
Breaking backward compatibility bumps the major (and resets the minor and patch)
New additions without breaking backward compatibility bumps the minor (and resets the patch)
Bug fixes and misc changes bumps the patch
CommandBox is open source and bound to the LGPL v3 GNU LESSER GENERAL PUBLIC LICENSE
Copyright by Ortus Solutions, Corp
CommandBox is a registered trademark by Ortus Solutions, Corp
Info The CommandBox Websites, Documentation, logo and content have a separate license and they are a separate entity.
The CommandBox help and discussion group can be found here: https://groups.google.com/a/ortussolutions.com/forum/#!forum/commandbox
We all make mistakes from time to time :) so why not let us know about it and help us out. We also love pull requests, so please star us and fork us: https://github.com/ortus-solutions/commandbox
CommandBox is professional open source software backed by Ortus Solutions, Corp offering services like:
Custom Development
Professional Support & Mentoring
Training
Server Tuning
Security Hardening
Code Reviews
Official Site: http://www.ortussolutions.com/products/commandbox
Source Code: https://github.com/ortus-solutions/commandbox
Twitter: @ortussolutions
Facebook: https://www.facebook.com/ortussolutions
Google+: https://google.com/+OrtusSolutions
Vimeo Channel: http://vimeo.com/channels/commandbox
Because of His grace, this project exists. If you don't like this, then don't read it, it's not for you.
"Therefore being justified by **faith**, we have peace with God through our Lord Jesus Christ: By whom also we have access by **faith** into this **grace** wherein we stand, and rejoice in hope of the glory of God." Romans 5:5
CommandBox is a Java-based executable that will run on most recent desktop operating systems (Linux, Mac OS X, Windows). Since it is a command line tool that uses a shell interface, it does not even require an operating system using a GUI. CommandBox can be used as a development aid and automation tool alongside your favorite CFML engine and IDE, but neither of those are requirements for installation of CommandBox.
Luis Majano is a Computer Engineer with over 15 years of software development and systems architecture experience. He was born in San Salvador, El Salvador in the late 70’s, during a period of economic instability and civil war. He lived in El Salvador until 1995 and then moved to Miami, Florida where he completed his Bachelors of Science in Computer Engineering at Florida International University. Luis resides in Houston, Texas with his beautiful wife Veronica, baby girl Alexia and baby boy Lucas!
He is the CEO of Ortus Solutions, a consulting firm specializing in web development, ColdFusion (CFML), Java development and all open source professional services under the ColdBox and ContentBox stack. He is the creator of ColdBox, ContentBox, WireBox, MockBox, LogBox and anything “BOX”, and contributes to many open source ColdFusion projects. He is also the Adobe ColdFusion user group manager for the Inland Empire. You can read his blog at www.luismajano.com
Luis has a passion for Jesus, tennis, golf, volleyball and anything electronic. Random Author Facts:
He played volleyball in the Salvadorean National Team at the tender age of 17
The Lord of the Rings and The Hobbit is something he reads every 5 years. (Geek!)
His first ever computer was a Texas Instrument TI-86 that his parents gave him in 1986. After some time digesting his very first BASIC book, he had written his own tic-tac-toe game at the age of 9. (Extra geek!)
He has a geek love for circuits, microcontrollers and overall embedded systems.
He has of late (during old age) become a fan of running and bike riding with his family.
Keep Jesus number one in your life and in your heart. I did and it changed my life from desolation, defeat and failure to an abundant life full of love, thankfulness, joy and overwhelming peace. As this world breathes failure and fear upon any life, Jesus brings power, love and a sound mind to everybody!
“Trust in the LORD with all your heart, and do not lean on your own understanding.” – Proverbs 3:5
Brad grew up in southern Missouri where he systematically disassembled every toy he ever owned which occasionally led to unintentional shock therapy (TVs hold charge long after they've been unplugged, you know). After high school he majored in Computer Science with a music minor at MidAmerica Nazarene University (Olathe, KS). Today he lives in Kansas City with his wife and three girls where he still disassembles most of his belongings (including automobiles) just with a slightly higher success rate of putting them back together again.) Brad enjoys church, all sorts of international food, and the great outdoors.
Brad has been programming CFML for 12+ years and has used every version of CF since 4.5. He first fell in love with ColdFusion as a way to easily connect a database to his website for dynamic pages. Brad blogs at (http://www.codersrevolution.com) and likes to work on solder-at-home digital and analog circuits with his daughter as well as building projects with Arduino-based microcontrollers.
Brad's CommandBox Snake high score is 141.
Jorge Reyes - ColdBox Aficionado
The source code for this book is hosted in GitHub: . You can freely contribute to it and submit pull requests. The contents of this book is copyright by and cannot be altered or reproduced without author's consent. All content is provided "As-Is" and can be freely distributed.
The majority of code examples in this book are done in cfscript
.
Flash, Flex, ColdFusion, and Adobe are registered trademarks and copyrights of Adobe Systems, Inc. Railo is a trademark and copyright of Railo Technologies, GmbH. Lucee is a trademark and copyright of Lucee Association Switzerland.
The information in this book is distributed “as is”, without warranty. The author and Ortus Solutions, Corp shall not have any liability to any person or entity with respect to loss or damage caused or alleged to be caused directly or indirectly by the content of this training book, software and resources described in it.
We highly encourage contribution to this book and our open source software. The source code for this book can be found in our where you can submit pull requests.
15% of the proceeds of this book will go to charity to support orphaned kids in El Salvador - . Please donate and purchase the printed version of this book as every book sold can help a child for almost 2 months.
Shalom now cares for over 80 children in El Salvador, from newborns to 18 years old. They receive shelter, clothing, food, medical care, education and life skills training in a Christian environment. The home is supported by a child sponsorship program.
We have personally supported Shalom since 2006; it is a place of blessing for many children in El Salvador that either have no families or have been abandoned. This is good earth to seed and plant.
Shalom Children’s Home () is one of the ministries that is dear to our hearts located in El Salvador. During the 12 year civil war that ended in 1990, many children were left orphaned or abandoned by parents who fled El Salvador. The Benners saw the need to help these children and received 13 children in 1982. Little by little, more children came on their own, churches and the government brought children to them for care, and the Shalom Children’s Home was founded.
CommandBox is a standalone, native Command Line Interface (CLI), Package Manager, Embedded CFML Server and Read Eval Print Loop (REPL) aimed to help ColdFusion (CFML) developers become more productive through automation, dependency management, command line-based tools, and ASCII snake games.
CommandBox is an amalgamation of many different tools and borrows concepts from NPM, Grunt/Gulp, Maven, Bower, and Node. Features include:
Command Line for ColdFusion (CFML)
Operating System integration for executing commands
Ability to create and execute commands built using ColdFusion (CFML)
ForgeBox integration for cloud package management and installations
ColdBox Platform, TestBox, and ContentBox CMS Integrations
Integrated servlet server with rewrite capabilities
Ability to create command recipes and execution
REPL (Read-Evaluate-Print-Loop) console for immediate ColdFusion
(CFML) interaction
Ability to interact with user via CLI and create workflows and
installers
Ability to execute workflows and tasks
Built-in Help system
Congratulations on your choice of CommandBox, the next generation of CFML productivity tooling! We're pleased you've chosen this product and we can't wait to help you get started with it. Setup is easy and painless. We'll walk you through the steps you need to become the jealous rage of your peers with the class of a Java guru, the hipster appeal of a Rubyist, and the ASCII art fetish of a Node.js developer.
Your CommandBox download was quality checked and shipped from our integration server with the following items. You'll want to check the contents of the package to ensure you received everthing.
CLI
Package Manager
Embedded CFML Server
REPL
Built-in Help
ASCII Art
If you don't already have CommandBox in hand, download it from the product page on the Ortus Solutions site:
If you already have Java 1.8 or higher installed on your PC, choose the No JRE Included download for your operating system. Otherwise, you can grab the With JRE Included for a single-download solution.
You're well on your way now. While you wait for arrival you might want to secure any loose hair or shirt sleeves and clear a clean space to work on your desktop. Safety first!
Your CommandBox is sent to you via a zip archive. Decompress the archive to a location of your choice. The No JRE Included download will only have one file in it named box
. For Windows users, this will be an exe
file. For unix-based users, it will be an executable binary. The With JRE Included version will have a jre
folder. You can move box.exe
, but keep the jre
folder in the same relative location as the executable so it can be found.
Now just double click the file from your GUI, or execute it via a console window. This will start a short, quick, one-time process of unpacking CommandBox into your user's home directory. Congratulations, CommandBox is now installed! You'll still run the same executable binary every time you want to use the CLI, but the extraction process won't need to happen again.
The green CommandBox>
prompt is what we call the interactive shell. Type exit
to close the window or be returned to your OS's native shell.
To open up the interactive shell at any time, just double click on the box
executable. If you prefer to stay in your OS's native shell, then just place the box
file in your system path and add it before any CommandBox commands like so:
The rest of this guide, however, will assume you're sitting at the interactive shell, where you can enjoy cross-platform command consistency, custom history, and tab completion.
The first command you'll want to try out is help
. Type it after a command, or even a partial command to get context-specific assistance. Check out the help for the version
command and then run it to see what you get.
Now, let's see if your installation is up to date with the upgrade
command:
Looking good. Let's try a bit of CFML code from the REPL, shall we? Type the repl
command to be dropped into the REPL prompt.
Type these lines one at a time and press enter to see what you get.
When you're done, just type quit
to exit the REPL. How does it feel to master CFML from the command line?
It's about time we did something useful. CommandBox allows you to install stuff and it makes it really easy. You now have ForgeBox on speed dial. Let's create a little playground to experiment in. Adjust these paths accordingly for Unix-based OS's.
I wonder how many projects Luis Majano has posted on ForgeBox. We can look with the forgebox search
command: Hint, try pressing tab
while typing a command for auto-completion.
Wow, that Luis guy is busy! Let's install the the ColdBox MVC Platform. Don't worry, this won't hurt a bit.
We can create a skeleton ColdBox app really easy with the ColdBox generator commands. Let's give them a try:
Now that we have a nifty little test app, let's give it a spin. Wait, you don't need to install a CF server, CommandBox has one built in! You can start up an ad-hoc server in any folder on your hard drive simply by typing start
. It really couldn't be any simpler.
In a few seconds, a browser window will appear with your running application. This is a full server with access to the web administrator where you can add data sources, mappings, or adjust the server settings. Notice the handy icon added to your system tray as well. You can even edit the files in your new site from the command line:
When you're done playing, just shutdown your server with the stop
command. It will save all of its settings for the next time you start it. Feel free to delete the playground directory at any time. It won't break a thing.
You're well on your way to becoming a more productive you. Experiment with CommandBox to see what else you can do with it. This rest of this documentation book is a good place to start. Also, we have full documentation of every command in our Command API Docs.
If you run into issues or just have questions, please jump on our CommandBox Google Group and ask away.
CommandBox is Professional Open Source under the LGPL license. We'd love to have your help with the product. Commands are actually implemented in CFML which means you can write your own and share them on ForgeBox. See if you can figure out how to find and install the "Chuck Norris" or "Image To ASCII" commands. Also, the snake
game is a good way to cure boredom. These should give you some ideas of how you can contribute.
Regardless of where you place the box binary, the first time you execute it, a .CommandBox
folder will be created in your user's home directory and CommandBox will be extracted into that location. If you delete this directory, it will be replaced the next time the CommandBox executable is run.
You can specify a different install location by adding -commandbox_home=E:\CommandBox
when you run the box binary.
To avoid specifying the commandbox_home variable every time you can create a file called commandbox.properties
(case sensitive) in the same directory as the binary, and fill it with this line:
Unzip the executable box.exe and just double click on it to open the shell. When you are finished running commands, you can just close the window, or type exit
.
Hint You can make the
box.exe
available in any Windows terminal by adding its location to thePATH
system environment variable. See
is a great Mac package manager, it can easily install and keep your CommandBox installation up to date (even binary releases), just run the following for stable releases:
To stay with current bleeding edge releases use the following:
Then run the box
binary to begin the one-time unpacking process.
Versions will be installed in /usr/local/Cellar/commandbox
. To switch between versions, simply use brew switch commandbox [version number]
If you want to use a commandbox.properties
file as mentioned above, your box
binary file will be in the /usr/local/Cellar/commandbox/<version>/bin/
directory where you should place your commandbox.properties
file. There will also be a box
alias in the /usr/local/bin/
directory where you should place the jre
if you want CommandBox to use a version of Java that is different from your default version reported by java -version
.
When using Homebrew to install CommandBox you must use Homebrew for any upgrade, minor or major. To upgrade CommandBox with Homebrew:
NOTE: If you use Homebrew to upgrade your version of CommandBox it will erase your commandbox.properties
file.
Unzip the binary box and just double click on it to open the shell terminal. When you are finished running commands, you can just close the window, or type exit
.
Hint You can place the binary in your
/usr/bin
directory so it can be available system-wide via thebox
command in any terminal window.
Please note that if you are running Ubuntu 18.04 or greater, or Debian 8 (Jessie) or greater, it's necessary to have the
libappindicator-dev
package in order to have the tray icon working correctly.
Run the following series of commands to add the Ortus signing key, register our Debian repo, and install CommandBox.
Then run the box
binary to begin the one-time unpacking process.
Add the following to: /etc/yum.repos.d/commandbox.repo
Then run:
After you have downloaded the commandbox.deb
file, install it using the dpkg
command.
Run the box
binary to begin the one-time unpacking process.
After you have downloaded the commandbox.rpm
file, install it using the rpm
command.
If you already have a Java JRE installed level 1.8 or higher (and set in your environment variables) you can download the non-JRE version for your Operating System. If you don't have a JRE installed or aren't sure, we would recommend you download the version with a JRE included. Below you will find the way to get the latest stable and bleeding edge releases. Please also note that in our installation page you will find much more detail information on how to install CommandBox with modern Operating System package managers as well.
Info The non-JRE versions are all around 80MB in size, while the embedded JRE versions will go up to 120MB in size.
Below you can see an image of the available downloads from the Ortus Solutions download page:
Stable versions of CommandBox can be downloaded from the downloads section of our product page. http://www.ortussolutions.com/products/commandbox#download
We use a Jenkins integration server to automate our builds. You can download a bleeding-edge version of CommandBox directly from our integration server here: https://downloads.ortussolutions.com/#/ortussolutions/commandbox/
Info Keep in mind, bleeding edge builds may contain experimental features that are likely to change or bugs.
Another way to get the bleeding edge version of CommandBox is to install the stable version and run our upgrade
command using the latest flag. Upgrade API docs.
Info Please note that the upgrade command will not update the main CommandBox binary. If there are major updates or you get a message about updating the binary, you will need to download the latest binary and re-install it.
CommandBox is a Java-based tool that involves several pieces including native Java classes, CFML code, and the embedded Railo CLI. However, most changes are confined to the CFML code managed by WireBox. To determine what version you have installed, use the version
command.
The auto-upgrade commands shown below will not upgrade the main CommandBox Java Binary. If there are any major upgrades to this binary, you will see a message that you will need to download the new Java binary and replace your current one.
To upgrade to the last stable version of the shell and commands, use the upgrade
command.
This command will connect to our server to determine the last stable build. If there is an upgrade, it will be downloaded and installed for you.
To upgrade to the bleeding edge version of the shell and commands, use the latest flag.
This command will connect to our server to determine the latest build. If there is an upgrade, it will be downloaded and installed for you.
If you already have the latest version installed, but you still want to force an upgrade, use the force parameter.
Note, if you delete your {user}/.CommandBox
folder and re-run the executable, the version of CommandBox in the executable will be unpacked regardless of any upgrades you may have installed in the mean time. On that note, another way to force an upgrade is to simply download the new executable, wipe the .CommandBox
folder in your user directory and re-run. This will also erase any saved command history, embedded servers, or installed user commands.
If you have used Hombrew to install CommandBox you must use Homebrew for any upgrade, minor or major. To upgrade CommandBox with Homebrew:
If you are just installing CommandBox to use on your PC as a local development tool, the standard version of the box binary should be fine. It contains a full version of Lucee with all its default extensions pre-installed. However, if you are creating an automation or a distributable such as a Docker container you may want to look into one of these alternative box binaries.
CommandBox Light does not include the full version of Lucee, but rather Lucee Light which only comes with the Compress extension (because CommandBox requires this extension to run). The CommandBox Light binary is roughly half the size of the normal version. The on-disk size of the CommandBox home is about 1/3rd of the size. This can be handy for places where disk size is very important.
Starting a default web server in CommandBox will give you a Lucee Light server, which may not run your app since it lacks extensions such as JBDC drivers and the admin. You can still ask for a specific version of Lucee with the cfengine
parameter. If you delete the engine
folder from a CommandBox Light installation, Lucee will not be able to work since the Lucee.jar file in CommandBox Light has had it's core.lco
file removed to make it smaller. Deleting the entire .CommandBox
folder will work however.
Any Task Runners or CLI automations in CommandBox light will also not be able to use things like JDBC drivers unless you install the extensions. Extensions can be installed by placing them in the CLI's server context deploy folder and waiting a minute:
You can download the CommandBox Light binary directly from our S3 artifacts repo:
box-light - Mac/Linux
box-light.exe - Windows
box-light.jar - Executable jar
The CommandBox Thin binary cannot be used by itself as it contains nothing inside of it but the Java bootstrap. It does not contain any of the other libraries, jars, or Lucee versions that CommandBox needs to load. it is only 300KB in size. The way that the 'thin" binary is to be used is to first download and run the normal CommandBox or CommandBox Light binary which will extract itself into the CommandBox Home. Once this has been completed, you can delete that box binary and replace it with the box-thin binary (renamed to box
). The new thin binary will take up less disk space and will simply use the existing CommandBox home that has been extracted.
The thin binary does not care whether the CommandBox home was extracted with a full or "light" version. This can create additional disk savings in an environment like Docker, but would not serve much of a purpose on your local development PC. If you delete your .CommandBox
folder, the CommandBox thin binary will not be able to recreate it.
You can download the CommandBox Light binary directly from our S3 artifacts repo:
box-thin - Mac/Linux
box-thin.exe - Windows
box-thin.jar - Executable jar