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.

Set Config Settings

1
config set name=mySetting
Copied!
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
1
config set modules.myModule.mySetting=foo
Copied!
Set item in an array
1
config set myArraySetting[1]="value"
Copied!
Set multiple params at once
1
config set setting1=value1 setting2=value2 setting3=value3
Copied!
Override a complex value as JSON
1
config set myArraySeting="[ '[email protected]', '[email protected]' ]"
Copied!
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.
1
config set myArraySetting="[ 'another value' ]" --append
Copied!

Show Config Settings

Output a setting:
1
config show settingName
Copied!
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
1
config show modules.myModule.settingName
2
config show mySettingArray[1]
Copied!
using JMESPath filter on the config show command
1
#normal selections like above just appended with the special `jq:` filter key
2
config show jq:modules.myModule.settingName
3
config show jq:mySettingArray[1]
4
5
# filter struct to just show name and modules values
6
config show 'jq:{name:name, modules:modules}'
7
8
# return all the key names from modules
9
config show 'jq:keys(modules)'
10
11
# return all the key names from modules where key contains the string 'book'
12
config show "jq:key_contains(modules,'book')"
13
14
# get command aliases and assign they key and value to {key: keyname, value: value}
15
config show 'jq:to_entries(command.aliases)'
16
[
17
{
18
"key":"git ",
19
"value":"!git "
20
}
21
]
Copied!

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.
1
config clear description
Copied!
Last modified 7mo ago