Skip to content

Command Line Tools

Wheels Config Dump Command Guide

The wheels config dump command exports your Wheels application configuration settings for inspection, backup, or migration purposes. It can display configurations in multiple formats and optionally mask sensitive values for security.

Terminal window
wheels config dump

This displays the current environment’s configuration in a formatted table in the console.

Terminal window
wheels config dump [environment] [--format=<type>] [--output=<file>] [--noMask]
ArgumentRequiredDescriptionDefault
environmentNoThe environment to dump (development, testing, production)Auto-detects from WHEELS_ENV or defaults to “development”
OptionDescriptionValuesDefault
--format=<type>Output format for the configurationtable, json, env, cfmlConsole: table
File: json
--output=<file>File path to save the configurationAny valid file pathNone (displays to console)
--noMaskDon’t mask sensitive values (passwords, keys, tokens, etc.)Flag (true/false)false (sensitive values are masked)

Specifies the output format for the configuration dump:

  • table: Formatted tables organized by category (best for console viewing)
  • json: Structured JSON format (best for programmatic use and file storage)
  • env: Environment variables format (.env compatible)
  • cfml: Wheels set() statements format

When specified, saves the configuration to a file instead of displaying to console. If no format is explicitly specified with --output, JSON format is automatically used for better file compatibility.

⚠️ Security Warning: This option exposes sensitive configuration data including passwords, API keys, and tokens. Only use when absolutely necessary and ensure the output is stored securely.

Displays configuration in organized categories with formatted tables:

  • DATABASE Settings
  • CACHING Settings
  • SECURITY Settings
  • ENVIRONMENT Settings
  • OTHER Settings

Exports configuration as structured JSON:

{
"datasource": "myapp",
"cacheQueries": false,
"environment": "development",
"_environment": {
"WHEELS_ENV": "development"
}
}

Exports as environment variables compatible with .env files:

Terminal window
## Application Settings
DATASOURCE=myapp
CACHE_QUERIES=false
ENVIRONMENT=development

Exports as Wheels set() statements:

// Wheels Configuration Export
set(datasource = "myapp");
set(cacheQueries = false);
set(environment = "development");
Terminal window
# View current configuration
wheels config dump
# View production configuration
wheels config dump production
Terminal window
# Backup as JSON (default for files)
wheels config dump --output=config-backup.json
# Backup with timestamp
wheels config dump --output="backup/config-$(date +%Y%m%d).json"
Terminal window
# Export different environments
wheels config dump development --output=dev-config.json
wheels config dump production --output=prod-config.json
# Then compare using diff tools
diff dev-config.json prod-config.json
Terminal window
# Create .env file template
wheels config dump --format=env --output=.env.template
# Create environment-specific files
wheels config dump production --format=env --output=.env.production
Terminal window
# Export from source server (masked)
wheels config dump --output=config-export.json
# Export with sensitive data (be careful!)
wheels config dump --noMask --output=config-complete.json
Terminal window
# Create settings file for another environment
wheels config dump --format=cfml --output=config/staging/settings.cfm

By default, the command masks sensitive values containing these keywords:

  • password
  • secret
  • key
  • token
  • apikey / api_key
  • private
  • credential
  • auth
  • passphrase
  • salt
  • pwd

Masked values appear as: ***MASKED***

Only use --noMask when:

  • You need complete configuration for migration
  • Output is being saved to a secure location
  • You’re in a development environment

Never commit unmasked configuration files to version control!

The command loads configuration from multiple sources in order:

  1. Base Settings: /config/settings.cfm
  2. Environment Settings: /config/[environment]/settings.cfm
  3. Environment Variables: .env file (if exists)

Environment detection checks (in order):

  1. .env file: WHEELS_ENV variable
  2. System environment: WHEELS_ENV variable
  3. System environment: ENVIRONMENT variable
  4. Default: development

When using --output:

  • No format specified: Automatically uses JSON format
  • Format specified: Uses the specified format
  • Notification: Displays which format was used in the success message
Terminal window
# These save as JSON
wheels config dump --output=config.json
wheels config dump --output=settings.txt
# This saves as ENV format
wheels config dump --format=env --output=settings.env
# This explicitly saves as table format
wheels config dump --format=table --output=config.txt
Terminal window
# View current configuration
wheels config dump
# View testing environment configuration
wheels config dump testing
# Export as JSON to console
wheels config dump --format=json
Terminal window
# Complete production backup (unmasked)
wheels config dump production --noMask --output=prod-complete.json
# Generate environment file for Docker
wheels config dump --format=env --output=docker/.env
# Create CFML settings for new environment
wheels config dump --format=cfml --output=config/custom/settings.cfm
# Quick masked backup with date
wheels config dump --output="backups/config-$(date +%Y%m%d-%H%M%S).json"
Terminal window
# CI/CD configuration validation
wheels config dump --format=json | jq '.datasource'
# Environment variable generation for deployment
wheels config dump production --format=env --output=/tmp/app.env

Error: “No settings.cfm file found in config directory” Solution: Ensure you’re running the command from your Wheels application root directory

Error: “Invalid format: [format]. Valid formats are: table, json, env, cfml” Solution: Use one of the supported formats: table, json, env, or cfml

Error: “Failed to write file” Solution: Ensure you have write permissions for the specified output directory

Issue: Always shows “development” environment Solution: Set the WHEELS_ENV environment variable or create a .env file with WHEELS_ENV=production

  1. Regular Backups: Schedule regular configuration exports as part of your backup strategy
  2. Version Control: Store masked configuration exports in version control for tracking changes
  3. Environment Validation: Use dumps to verify configuration changes before deployment
  4. Security First: Always use masked output unless absolutely necessary
  5. Documentation: Keep exported configurations with deployment documentation

For issues or questions about the wheels config dump command:

  1. Check the Wheels documentation
  2. Verify your Wheels and CommandBox versions are compatible
  3. Ensure proper file permissions and paths
  4. Review the command output for specific error messages