Installation and Locations
A module is nothing more than a folder that contains a
ModuleConfig.cfcfile. The only requirement for that CFC is that it contains a method called
configure(). Modules can also contain models, interceptors, commands, and pretty much anything else you want to stick in them. As long as they contain a
box.jsonin their root, they are also a package, which means they are self-describing, can install dependencies, and can be installed via the
CommandBox has two default
The first is for system modules so you shouldn't need to touch it. All the built-in commands are in those modules, so feel free to check out how they work. All user-installed modules are in the second folder. The
cfmlfolder is the "root" of the CommandBox installation, so there will also be a
box.jsoncreated in that folder once you start installing modules via the
The first way to create a module is to manually create a folder in the
~/.CommandBox/cfml/modulesdirectory and place your
ModuleConfig.cfcinside of it. This is the process described in the guide on creating your first module.
If you have a package of type
commandbox-moduleslocally, in a Git repo, or in Forgebox, you can install from any working directory. When CommandBox sees the package type, it will change the installation directory to be the user modules folder.