Command Line Tools
Wheels Config Dump Command Guide
Wheels Config Dump Command Guide
Section titled “Wheels Config Dump Command Guide”Overview
Section titled “Overview”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.
Basic Usage
Section titled “Basic Usage”wheels config dumpThis displays the current environment’s configuration in a formatted table in the console.
Command Syntax
Section titled “Command Syntax”wheels config dump [environment] [--format=<type>] [--output=<file>] [--noMask]Arguments and Options
Section titled “Arguments and Options”Positional Arguments
Section titled “Positional Arguments”| Argument | Required | Description | Default |
|---|---|---|---|
environment | No | The environment to dump (development, testing, production) | Auto-detects from WHEELS_ENV or defaults to “development” |
Options
Section titled “Options”| Option | Description | Values | Default |
|---|---|---|---|
--format=<type> | Output format for the configuration | table, json, env, cfml | Console: tableFile: json |
--output=<file> | File path to save the configuration | Any valid file path | None (displays to console) |
--noMask | Don’t mask sensitive values (passwords, keys, tokens, etc.) | Flag (true/false) | false (sensitive values are masked) |
Option Details
Section titled “Option Details”--format
Section titled “--format”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
--output
Section titled “--output”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.
--noMask
Section titled “--noMask”⚠️ 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.
Output Formats
Section titled “Output Formats”Table Format (Console Default)
Section titled “Table Format (Console Default)”Displays configuration in organized categories with formatted tables:
- DATABASE Settings
- CACHING Settings
- SECURITY Settings
- ENVIRONMENT Settings
- OTHER Settings
JSON Format (File Default)
Section titled “JSON Format (File Default)”Exports configuration as structured JSON:
{ "datasource": "myapp", "cacheQueries": false, "environment": "development", "_environment": { "WHEELS_ENV": "development" }}Environment Variables Format (.env)
Section titled “Environment Variables Format (.env)”Exports as environment variables compatible with .env files:
## Application SettingsDATASOURCE=myappCACHE_QUERIES=falseENVIRONMENT=developmentCFML Format
Section titled “CFML Format”Exports as Wheels set() statements:
// Wheels Configuration Exportset(datasource = "myapp");set(cacheQueries = false);set(environment = "development");Common Use Cases
Section titled “Common Use Cases”1. Quick Configuration Review
Section titled “1. Quick Configuration Review”# View current configurationwheels config dump
# View production configurationwheels config dump production2. Backup Configuration
Section titled “2. Backup Configuration”# Backup as JSON (default for files)wheels config dump --output=config-backup.json
# Backup with timestampwheels config dump --output="backup/config-$(date +%Y%m%d).json"3. Environment Comparison
Section titled “3. Environment Comparison”# Export different environmentswheels config dump development --output=dev-config.jsonwheels config dump production --output=prod-config.json
# Then compare using diff toolsdiff dev-config.json prod-config.json4. Generate Environment Files
Section titled “4. Generate Environment Files”# Create .env file templatewheels config dump --format=env --output=.env.template
# Create environment-specific fileswheels config dump production --format=env --output=.env.production5. Migration Between Servers
Section titled “5. Migration Between Servers”# 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.json6. Generate CFML Settings
Section titled “6. Generate CFML Settings”# Create settings file for another environmentwheels config dump --format=cfml --output=config/staging/settings.cfmSecurity Considerations
Section titled “Security Considerations”Automatic Masking
Section titled “Automatic Masking”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***
Using —noMask
Section titled “Using —noMask”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!
Configuration Sources
Section titled “Configuration Sources”The command loads configuration from multiple sources in order:
- Base Settings:
/config/settings.cfm - Environment Settings:
/config/[environment]/settings.cfm - Environment Variables:
.envfile (if exists)
Environment detection checks (in order):
.envfile:WHEELS_ENVvariable- System environment:
WHEELS_ENVvariable - System environment:
ENVIRONMENTvariable - Default:
development
File Output Behavior
Section titled “File Output Behavior”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
# These save as JSONwheels config dump --output=config.jsonwheels config dump --output=settings.txt
# This saves as ENV formatwheels config dump --format=env --output=settings.env
# This explicitly saves as table formatwheels config dump --format=table --output=config.txtExamples
Section titled “Examples”Basic Examples
Section titled “Basic Examples”# View current configurationwheels config dump
# View testing environment configurationwheels config dump testing
# Export as JSON to consolewheels config dump --format=jsonAdvanced Examples
Section titled “Advanced Examples”# Complete production backup (unmasked)wheels config dump production --noMask --output=prod-complete.json
# Generate environment file for Dockerwheels config dump --format=env --output=docker/.env
# Create CFML settings for new environmentwheels config dump --format=cfml --output=config/custom/settings.cfm
# Quick masked backup with datewheels config dump --output="backups/config-$(date +%Y%m%d-%H%M%S).json"Pipeline Integration
Section titled “Pipeline Integration”# CI/CD configuration validationwheels config dump --format=json | jq '.datasource'
# Environment variable generation for deploymentwheels config dump production --format=env --output=/tmp/app.envTroubleshooting
Section titled “Troubleshooting”No settings.cfm file found
Section titled “No settings.cfm file found”Error: “No settings.cfm file found in config directory” Solution: Ensure you’re running the command from your Wheels application root directory
Invalid format specified
Section titled “Invalid format specified”Error: “Invalid format: [format]. Valid formats are: table, json, env, cfml” Solution: Use one of the supported formats: table, json, env, or cfml
File write permissions
Section titled “File write permissions”Error: “Failed to write file” Solution: Ensure you have write permissions for the specified output directory
Environment not detected
Section titled “Environment not detected”Issue: Always shows “development” environment Solution: Set the WHEELS_ENV environment variable or create a .env file with WHEELS_ENV=production
Best Practices
Section titled “Best Practices”- Regular Backups: Schedule regular configuration exports as part of your backup strategy
- Version Control: Store masked configuration exports in version control for tracking changes
- Environment Validation: Use dumps to verify configuration changes before deployment
- Security First: Always use masked output unless absolutely necessary
- Documentation: Keep exported configurations with deployment documentation
Support
Section titled “Support”For issues or questions about the wheels config dump command:
- Check the Wheels documentation
- Verify your Wheels and CommandBox versions are compatible
- Ensure proper file permissions and paths
- Review the command output for specific error messages