arrow-left

All pages
gitbookPowered by GitBook
1 of 6

Loading...

Loading...

Loading...

Loading...

Loading...

Loading...

Module Settings

These settings affect how CommandBox loads modules.

hashtag
ModulesExternalLocation

array

You can store CommandBox modules outside of the default installation directory. This may be useful to point to modules you are developing or to keep custom modules around even if CommandBox gets uninstalled.

hashtag
modulesInclude

array

An array of module names to load. Be careful of using this setting as once you set it, no other modules will be loaded which includes all of CommandBox's core modules.

hashtag
ModulesExclude

array

An array of module names NOT to load. This can be useful when you have an installed module that's erroring on load and preventing CommandBox from starting up.

hashtag
modules.*

struct

When you install a CommandBox module, it may contain settings that affect how it works. Don't edit the CFML code in the module, instead use the config set command to create config settings that will override the module's defaults. The pattern is modules.moduleName.settingName.

When a module is loaded, the config settings (that exist) for that module are loaded as well. Any time you set a new module setting, that setting will be loaded into memory immediately for that module.

You can easily see what settings are set for our TestModule like so:

Config Settings

CommandBox has a global configuration file that stores user settings. It is located in ~/.CommandBox/CommandBox.json and can be used to customize core CommandBox behaviors as well as overriding module settings. Config settings are managed by the config set, config show, and config clear commands.

hashtag
Set Config Settings

config set name=mySetting

Nested attributes may be set by specifying dot-delimited names or using array notation. If the set value is JSON, it will be stored as a complex value in the commandbox.json.

Set module setting

Set item in an array

Set multiple params at once

Override a complex value as JSON

Structs and arrays can be appended to using the "append" parameter. Add an additional settings to the existing list. This only works if the property and incoming value are both of the same complex type.

hashtag
Show Config Settings

Output a setting:

Nested attributes may be accessed by specifying dot-delimited names or using array notation. If the accessed property is a complex value, the JSON representation will be displayed

hashtag
Clear Config Setting

To Remove a setting out of the CommandBox.json use the config clear command. Nested attributes may be set by specifying dot-delimited names or using array notation.

Misc Settings

These are some one-off settings that doen't really belong anywhere else.

hashtag
nativeShell

string

This setting affects how CommandBox invokes the shell for the run command or when using the !binary

config set ModulesExternalLocation=[\"/var/my/external/modules\"]
config show ModulesExternalLocation
config set modules.myModule.mySetting=foo
shortcut. The default *nix shell used for the
run
command is
/bin/sh
but you can override it to use a custom shell. Set the full path to the shell binary.

hashtag
tagVersion

boolean

Running the bump command from a Git repo will attempt to tag the repo unless you provide the tagVersion parameter. This setting provides a global default to prevent CommandBox from trying to tag Git repos.

hashtag
tagPrefix

string

Running the bump command from a Git repo will tag the repo using the format v{version} such as v1.0.0 or v4.3.6. You can remove the v or swap it for another prefix using the tagPrefix parameter. Remember, another string like foo1.2.3 will not be parseable by CommandBox as a valid semver. This setting can be overriden by the tagPrefix parameter to the bump command.

hashtag
artifactsDirectory

string

You can control where your artifact cache is stored with the artifactsDirectory config setting. This can be useful to keep your primary drive from filling up, or to point your files to a shared network drive that your coworkers can share.

config set modulesInclude=[\"moduleName\",\"anotherModuleName\"]
config show modulesInclude
config set ModulesExclude=[\"moduleName\",\"anotherModuleName\"]
config show ModulesExclude
config set modules.TestModule.mySetting=overridden
config set modules.TestModule.somethingEnabled=false
config show modules.TestModule
config set myArraySetting[1]="value"
config set setting1=value1 setting2=value2 setting3=value3
config set myArraySeting="[ '[email protected]', '[email protected]' ]"
config set myArraySetting="[ 'another value' ]" --append
config show settingName
config show modules.myModule.settingName
config show mySettingArray[1]
config clear description
config set nativeShell=/bin/zsh
config show nativeShell
config set tagVersion=false
config show tagVersion
config set tagPrefix=''
config show tagPrefix
config set artifactsDirectory=/path/to/artifacts
config show artifactsDirectory

Proxy Settings

If you need to use CommandBox behind a corporate proxy, these settings will be necessary for it to successfully connect to the Internet.

hashtag
proxy.server

string

This is the URL of the proxy server on your network.

config set proxy.server=myProxy.com
config show proxy.server

hashtag
proxy.port

integer

This is the port to connect to on the proxy server.

hashtag
proxy.user

string

This is the username to connect to the proxy server with, if required.

hashtag
proxy.password

string

This is the password to connect to the proxy server with, if required.

Endpoint Settings

These settings are used to configure CommandBox's endpoints.

hashtag
endpoints.forgebox.APIToken

string

The API Token provided to you when you signed up for . This will be set for you automatically when you use the forgebox register or

config set proxy.port=9000
config show proxy.port
forgebox login
commands. This token will be sent to ForgeBox to authenticate you. Please do not share this secret token with others as it will give them permission to edit your packages!

hashtag
endpoints.forgebox.APIURL

string

This is the URL of the ForgeBox REST API. Remove this setting to use the default. If you wish to test submitting package in an environment other than production, you may point to our staging server. Note, this will funnel ALL ForgeBox calls to the staging server where your APIToken may be different.

ForgeBox.ioarrow-up-right
config set endpoints.forgebox.APIToken=my-very-long-secret-key
config show endpoints.forgebox.APIToken
config set endpoints.forgebox.APIURL=https://forgebox.stg.ortussolutions.com/api/v1
config show endpoints.forgebox.APIURL
config set proxy.user=proxyUser
config show proxy.user
config set proxy.password=proxyPass
config show proxy.password

Server Settings

These settings control how servers start in CommandBox.

hashtag
server.defaults

struct

This struct can contain any setting that is valid in a server.json file. These settings are used as global default settings if there is not a corresponding setting provided by the user via a parameter to the start command or in the server's server.json file.

config set server.defaults.web.rewrites.enable=true
config set server.defaults.openbrowser=false
config set server.defaults.jvm.heapsize=1024
config show server.defaults