Blog

ColdBox Free Tip 3: CommandBox ColdBox Commands

Maria Jose Herrera October 16, 2024

Spread the word

Maria Jose Herrera

October 16, 2024

Spread the word


Share your thoughts

102 ColdBox Tips and Ticks by Luis Majano

What is CommandBox and why is a key tool for ColdBox users?

CommandBox isn't just a powerful CLI for CFML—it’s also packed with tools to make ColdBox development faster and more efficient. In this tip, we’ll explore some of the most useful ColdBox-specific commands that can make your development life easier.

ColdBox CLI

All the CommandBox commands for ColdBox are encapsulated in the coldbox-cli package that comes pre-bundled with CommandBox. However, just to make sure let’s install it again to get the latest and greatest.


install coldbox-cli --force

CommandBox ColdBox Commands

CommandBox comes with a coldbox namespace loaded with commands to assist you throughout your ColdBox development journey. Whether you need to generate complete applications, monitor your code edits, or quickly reinit your framework, these commands have got you covered.

ColdBox Book

To see all available ColdBox commands, just run:

coldbox ?

You’ll get a list of namespaces and commands that make your workflow smoother. Let’s take a look at a few key commands:

Example


Example 1

Top-level ColdBox Commands:

  • reinit: Quickly reinitialize your running ColdBox application without restarting the server.

    coldbox reinit
    
  • watch-reinit: Set up an async watcher to monitor your file changes. If a file is modified, ColdBox will automatically reinit the app for you. This is super handy during development to keep things in sync without constant manual restarts.

    coldbox watch-reinit
    

Creation Commands:

CommandBox's coldbox create namespace allows you to generate various ColdBox elements easily:

  • coldbox create ?: Shows all the available commands under the create namespace.

Use this to generate handlers, modules, interceptors, and much more, right from the CLI. It’s a huge time-saver, letting you scaffold your application with ease.


Try out these commands next time you’re building with ColdBox and let CommandBox do the heavy lifting for you! Keep an eye out for our next tip, and as always, happy coding!

Example


Example 1

Learn More ColdBox Tips and Tricks

Stay tuned for more ColdBox tips in our ongoing series. if you want to learn more than 10 free tips and tricks make sure to get your “ColdBox 102 tips and tricks book” We have a variety of formats you can choose from.

Get your Copy

Add Your Comment

(3)

Oct 16, 2024 18:07:29 UTC

by Will B.

Didn't know about "watch-reinit". I find, however, that (in dev), it's generally easier to set my Wirebox services to .into(THIS.SCOPES.REQUEST) while I'm working, and then just make sure I don't commit those changes. I'm generally working in one or two services and this is usually faster than any reinit. But that might be really, really good for a production (non-HA) at the end of a build process! :D

Oct 21, 2024 16:45:53 UTC

by Luis Majano

That's a great alternative too. We also improved the WireBox Singleton Auto-Reload in the latest version of ColdBox as well.

Oct 21, 2024 20:17:00 UTC

by Will B.

Don't know what that is, the WireBox Singleton Auto-Reload feature.

Recent Entries

The Hidden Costs of In-House Database Management

The Hidden Costs of In-House Database Management

The Hidden Costs of In-House Database Management


Opting for in-house database management involves more than just a salary. Here are some often-overlooked costs associated with maintaining your own DBA team.



1. High Salaries and Benefits


Hiring skilled DBAs is expensive. According to industry reports, the average salary of a DBA in the U.S. can range from $85,000 to over $130,000 per year, depending on experience and expertise. When you add ...

Cristobal Escobar
Cristobal Escobar
November 20, 2024
5 Signs It’s Time to Modernize Your ColdFusion / CFML Application

5 Signs It’s Time to Modernize Your ColdFusion / CFML Application

ColdFusion has long been a reliable platform for building web applications, but like any technology, it requires maintenance and modernization over time. Whether you're using Lucee or Adobe ColdFusion, it’s critical to recognize the signs that your application is no longer meeting today’s standards in performance, security, and scalability. Let’s explore five clear indicators that it’s time to modernize your ColdFusion application and how ColdFusion consulting can help breathe new life into y...

Cristobal Escobar
Cristobal Escobar
November 19, 2024
ColdBox Free Tip 5 - Building Named Routes with a Struct

ColdBox Free Tip 5 - Building Named Routes with a Struct

**Did you know ColdBox provides flexible ways to build routes using structs?** In this tip, we’ll cover how to use the `event.buildLink()` and `event.route()` methods for named routes, a feature that’s especially handy when working with dynamic URLs.

Maria Jose Herrera
Maria Jose Herrera
November 19, 2024