Set/View Settings

View all configuration

1
cfconfig show
2
cfconfig show serverName
3
cfconfig show /path/to/server/install/home
Copied!

View a specific configuration setting

1
cfconfig show requestTimeout
2
cfconfig show requestTimeout serverName
3
cfconfig show requestTimeout /path/to/server/install/home [email protected]
Copied!

Set a configuration setting

Note, this command requires named parameters.
1
cfconfig set adminPassword=commandbox
2
cfconfig set adminPassword=commandbox to=serverName
3
cfconfig set adminPassword=commandbox to=/path/to/server/install/home toFormat=[email protected]
Copied!
You can actually use CFConfig set to manage the static contents of a JSON export. The JSON file is, after all, just another location you can read from or write to.
1
# Pull current config from server into JSON file
2
cfconfig export myConfig.json
3
# Edit JSON file directly
4
cfconfig set adminPassword=commandbox to=myConfig.json
Copied!

Using "deep" property names

The cfconfig set and cfconfig show commands work the same as package set/show in that you can use "deep" keys to access nested properties.
1
cfconfig show datasources.myDSN
2
cfconfig show mailServers[1].port
3
cfconfig set loggers.deploy.level=debug
4
cfconfig set datasources.myDSN.password=myPass
Copied!
Keep in mind that examples such as the last line above can create invalid config if you don't already have a datasource called myDSN. If you're needing to create new complex objects, or you're not sure if they will exist, use the other CFConfig namespaces like cfconfig datasource save which will ensure complete settings are saved.
Last modified 3mo ago