CFConfig Documentation
  • Introduction
  • The Basics
    • About This Book
    • Authors
    • Overview
    • Getting Started Guide
    • Supported Engines
    • Config Items
  • Using the CLI
    • Installation
    • Usage
    • CommandBox Server Interceptors
      • Server Start
      • Server Stop
    • Command Overview
      • Export Settings
      • Import Settings
      • Transfer Settings
      • Diff Settings
      • Set/View Settings
      • Manage Datasources
      • Manage CF Mappings
      • Manage Caches
      • Manage Mail Servers
      • Manage Event Gateway Configuration
      • Manage Event Gateway Instances
      • Manage Lucee Loggers
      • Manage Scheduled Tasks
    • JSON File Storage
    • Env Var Overrides
  • Using the Services
    • Installation
    • Component Overview
    • API Overview
Powered by GitBook
On this page
  • View all configuration
  • View a specific configuration setting
  • Set a configuration setting
  • Using "deep" property names

Was this helpful?

Edit on GitHub
Export as PDF
  1. Using the CLI
  2. Command Overview

Set/View Settings

View all configuration

cfconfig show
cfconfig show serverName
cfconfig show /path/to/server/install/home

View a specific configuration setting

cfconfig show requestTimeout
cfconfig show requestTimeout serverName
cfconfig show requestTimeout /path/to/server/install/home adobe@11

Set a configuration setting

Note, this command requires named parameters.

cfconfig set adminPassword=commandbox
cfconfig set adminPassword=commandbox to=serverName
cfconfig set adminPassword=commandbox to=/path/to/server/install/home toFormat=adobe@11

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.

# Pull current config from server into JSON file
cfconfig export myConfig.json
# Edit JSON file directly
cfconfig set adminPassword=commandbox to=myConfig.json

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.

cfconfig show datasources.myDSN
cfconfig show mailServers[1].port
cfconfig set loggers.deploy.level=debug
cfconfig set datasources.myDSN.password=myPass

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.

PreviousDiff SettingsNextManage Datasources

Last updated 3 years ago

Was this helpful?