arrow-left

All pages
gitbookPowered by GitBook
1 of 7

Loading...

Loading...

Loading...

Loading...

Loading...

Loading...

Loading...

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.

config set modules.myModule.mySetting=foo
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

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.

config set ModulesExternalLocation=[\"/var/my/external/modules\"]
config show ModulesExternalLocation

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:

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 ForgeBox.ioarrow-up-right. This will be set for you automatically when you use the forgebox register or 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.

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.

JSON Settings

You can customize the way that JSON is formatted when it's written to files such as server.json and box.json as well as how it displays in the console when using commands such as server show and package show

hashtag
JSON.indent

string

String to use for indenting lines. Defaults to four spaces.

hashtag
JSON.lineEnding

string

String to use for line endings. Defaults to CRLF on Windows and LF on *nix. Pass the actual character to use, not a placeholder.

hashtag
JSON.spaceAfterColon

boolean

Add space after each colon like "value": true instead of "value":true Defaults to false

hashtag
JSON.sortKeys

string

Specify a sort type to sort the keys of json objects: text or textnocase

hashtag
JSON.ANSIColors

struct

A struct of colors to use when displaying JSON in the CLI. You can use any color name from the system-colors command or a direct ANSI escape sequence.

hashtag
JSON.ANSIColors.constant

string

The color to use for constant values (true/false/null). Defaults to "red".

hashtag
JSON.ANSIColors.key

string

The color to use for object key names. Defaults to "blue".

hashtag
JSON.ANSIColors.number

string

The color to use for numbers. Defaults to "aqua".

hashtag
JSON.ANSIColors.string

string

The color to use for quoted string values. Defaults to "lime".

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 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.

hashtag
preferredBrowser

string

Used to override the default browser to open when a server starts, or when using a command like server open or calling the openURL() method from a command or Task Runner. Possible values are:

  • firefox

  • chrome

  • opera

hashtag
tabCompleteInline

boolean

You can change CommandBox's default tab completion to be an inline list that follows your cursor. This setting requires you to close and re-open the shell to take affect.

config set proxy.port=9000
config show proxy.port
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 server.defaults.web.rewrites.enable=true
config set server.defaults.openbrowser=false
config set server.defaults.jvm.heapsize=1024
config show server.defaults
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 proxy.user=proxyUser
config show proxy.user
config set proxy.password=proxyPass
config show proxy.password
config set JSON.indent="  "
config set JSON.lineEnding=`#chr 10`
config set JSON.spaceAfterColon=true
config set JSON.sortKeys=textnocase
config set JSON.ANSIColors.constant=PaleTurquoise1
config set JSON.ANSIColors.key=Purple5
config set JSON.ANSIColors.number=SeaGreen3
config set JSON.ANSIColors.string=MistyRose3
edge (Windows and Mac only)
  • ie (Windows only)

  • safari (Mac only)

  • konqueror (Linux only)

  • epiphany (Linux only)

  • 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
    config set preferredBrowser=chrome
    config show preferredBrowser
    config set tabCompleteInline=true
    config show tabCompleteInline