Command Line Tools
Wheels env Show
Wheels env Show
Section titled “Wheels env Show”Overview
Section titled “Overview”The wheels env show command displays environment variables from .env files in your Wheels project. This command provides a convenient way to view your application’s configuration, with intelligent grouping, security masking, and multiple output formats. It helps you understand what environment variables are available and how they’re organized.
Command Syntax
Section titled “Command Syntax”wheels env show [options]Parameters
Section titled “Parameters”Optional Parameters
Section titled “Optional Parameters”| Parameter | Description | Default |
|---|---|---|
--key | Show a specific environment variable by key name | - |
--format | Output format: table or json | table |
--file | Specific .env file to read | .env |
Basic Usage Examples
Section titled “Basic Usage Examples”Show All Variables (Default)
Section titled “Show All Variables (Default)”wheels env showDisplays all environment variables from .env in a grouped, readable table format
Show Specific Variable
Section titled “Show Specific Variable”wheels env show --key=DB_HOSTShows only the DB_HOST variable and its value
Show in JSON Format
Section titled “Show in JSON Format”wheels env show --format=jsonOutputs all variables as formatted JSON
Show from Different File
Section titled “Show from Different File”wheels env show --file=.env.productionDisplays variables from .env.production instead of .env
Advanced Usage Examples
Section titled “Advanced Usage Examples”Development vs Production Comparison
Section titled “Development vs Production Comparison”# View development variableswheels env show --file=.env.development
# View production variableswheels env show --file=.env.productionCheck Specific Configuration
Section titled “Check Specific Configuration”# Check database configurationwheels env show --key=DB_NAMEwheels env show --key=DB_HOST
# Check API settingswheels env show --key=API_KEYOutput Formats
Section titled “Output Formats”Table Format (Default)
Section titled “Table Format (Default)”The table format groups variables by prefix and displays them in an organized, readable way:
================================================== Environment Variables Viewer==================================================
Environment Variables from .env--------------------------------------------------╔════════════╤═════════════╤════════╗║ Variable │ Value │ Source ║╠════════════╪═════════════╪════════╣║ DB_NAME │ myapp │ .env ║╟────────────┼─────────────┼────────╢║ DB_PORT │ 3306 │ .env ║╟────────────┼─────────────┼────────╢║ DB_USER │ root │ .env ║╟────────────┼─────────────┼────────╢║ wheels_env │ development │ .env ║╚════════════╧═════════════╧════════╝
Total variables: 4[INFO]: Usage tips: - Access in app: application.env['VARIABLE_NAME'] - Use in config: set(value=application.env['VARIABLE_NAME']) - Wheels loads .env automatically on app start - Update: wheels env set KEY=VALUEJSON Format
Section titled “JSON Format”Clean JSON output suitable for processing or integration:
{ "API_BASE_URL": "https://api.example.com", "API_KEY": "********", "APP_NAME": "My Application", "DB_HOST": "localhost", "DB_NAME": "myapp", "DB_PASSWORD": "********", "DB_PORT": "3306", "DEBUG_MODE": "true", "WHEELS_ENV": "development"}Features
Section titled “Features”Intelligent Grouping
Section titled “Intelligent Grouping”Variables are automatically grouped by prefix for better organization:
- DB_* variables (database configuration)
- API_* variables (API settings)
- WHEELS_* variables (framework settings)
- Other Variables (ungrouped items)
Security Masking
Section titled “Security Masking”Sensitive values are automatically masked when displayed:
- Variables containing
password→******** - Variables containing
secret→******** - Variables containing
key→********
The actual values remain unchanged in your files - only the display is masked.
Supported File Formats
Section titled “Supported File Formats”Properties Format (Standard .env)
Section titled “Properties Format (Standard .env)”## Database ConfigurationDB_HOST=localhostDB_PORT=3306DB_NAME=myappDB_USER=wheelsDB_PASSWORD="secret123"
## Application SettingsWHEELS_ENV=developmentDEBUG_MODE=trueJSON Format
Section titled “JSON Format”{ "DB_HOST": "localhost", "DB_PORT": "3306", "DB_NAME": "myapp", "WHEELS_ENV": "development", "DEBUG_MODE": "true"}Quote Handling
Section titled “Quote Handling”The command automatically handles quoted values:
- Double quotes:
KEY="value with spaces" - Single quotes:
KEY='another value' - Quotes are stripped from displayed values
Error Handling and Validation
Section titled “Error Handling and Validation”Project Validation
Section titled “Project Validation”The command ensures you’re in a valid Wheels project:
This command must be run from a Wheels project root directoryMissing File Handling
Section titled “Missing File Handling”If the specified .env file doesn’t exist, you’ll see helpful guidance:
No .env file found in project root
Create a .env file with key=value pairs, for example:--------------------------------------------------
[INFO]: Use 'wheels env set KEY=VALUE' to create environment variables╔══════════════╤══════════════════════════╤═════════════╗║ Source │ Variable │ Value ║╠══════════════╪══════════════════════════╪═════════════╣║ │ # Database Configuration │ ║╟──────────────┼──────────────────────────┼─────────────╢║ .env.example │ DB_HOST │ localhost ║╟──────────────┼──────────────────────────┼─────────────╢║ .env.example │ DB_PORT │ 3306 ║╟──────────────┼──────────────────────────┼─────────────╢║ .env.example │ DB_NAME │ myapp ║╟──────────────┼──────────────────────────┼─────────────╢║ .env.example │ DB_USER │ wheels ║╟──────────────┼──────────────────────────┼─────────────╢║ .env.example │ DB_PASSWORD │ secret ║╟──────────────┼──────────────────────────┼─────────────╢║ │ # Application Settings │ ║╟──────────────┼──────────────────────────┼─────────────╢║ .env.example │ WHEELS_ENV │ development ║╟──────────────┼──────────────────────────┼─────────────╢║ .env.example │ WHEELS_RELOAD_PASSWORD │ mypassword ║╚══════════════╧══════════════════════════╧═════════════╝Key Not Found
Section titled “Key Not Found”When requesting a specific key that doesn’t exist:
[WARNING]: Environment variable 'API_BASE_URL' not found in .env
Available Variables in .env--------------------------------------------------╔═══════════════╤═════════════════════╗║ Current Value │ Available Variables ║╠═══════════════╪═════════════════════╣║ myapp │ DB_NAME ║╟───────────────┼─────────────────────╢║ 3306 │ DB_PORT ║╟───────────────┼─────────────────────╢║ root │ DB_USER ║╚═══════════════╧═════════════════════╝Common Use Cases
Section titled “Common Use Cases”Configuration Review
Section titled “Configuration Review”# Review all current settingswheels env show
# Check what's different between environmentswheels env show --file=.env.developmentwheels env show --file=.env.productionDebugging Configuration Issues
Section titled “Debugging Configuration Issues”# Check if a specific variable is setwheels env show --key=DB_HOST
# Verify API configurationwheels env show --key=API_BASE_URLwheels env show --key=API_KEYEnvironment Setup Verification
Section titled “Environment Setup Verification”# Verify development setupwheels env show --file=.env.development
# Check staging configurationwheels env show --file=.env.stagingDocumentation and Export
Section titled “Documentation and Export”# Generate configuration documentationwheels env show --format=json > docs/environment-config.json
# Create environment templatewheels env show --file=.env.exampleIntegration with Wheels Framework
Section titled “Integration with Wheels Framework”The command provides helpful tips on how to use the variables in your Wheels application:
<!-- In your Wheels application --><cfset dataSource = application.env['DB_NAME']><cfset apiKey = application.env['API_KEY']><cfset debugMode = application.env['DEBUG_MODE']>
<!-- In config files --><cfset set(dataSourceName=application.env['DB_NAME'])><cfset set(URLRewriting=application.env['URL_REWRITING'])>Best Practices
Section titled “Best Practices”1. Regular Configuration Review
Section titled “1. Regular Configuration Review”# Regularly review your environment configurationwheels env show2. Environment-Specific Checks
Section titled “2. Environment-Specific Checks”# Always verify environment-specific settingswheels env show --file=.env.production --key=WHEELS_ENVwheels env show --file=.env.development --key=DEBUG_MODE3. Security Verification
Section titled “3. Security Verification”# Check that sensitive values are properly setwheels env show --key=API_KEYwheels env show --key=DB_PASSWORD4. Documentation Generation
Section titled “4. Documentation Generation”# Generate configuration documentationwheels env show --format=json > config-docs.json5. Troubleshooting Workflow
Section titled “5. Troubleshooting Workflow”# When debugging configuration issues:# 1. Check if variable existswheels env show --key=PROBLEMATIC_VAR
# 2. Review all variables for typoswheels env show
# 3. Compare against working environmentwheels env show --file=.env.workingIntegration Tips
Section titled “Integration Tips”With Other Wheels Commands
Section titled “With Other Wheels Commands”# View current config, then update if neededwheels env show --key=DB_HOSTwheels env set DB_HOST=newhost.com
# Check merged configurationwheels env merge .env.base .env.local --dry-runwheels env show --file=.env.mergedCI/CD Integration
Section titled “CI/CD Integration”# In deployment scriptswheels env show --file=.env.production --format=json | jq '.DB_HOST'Development Workflow
Section titled “Development Workflow”# Quick environment check during developmentwheels env show --key=WHEELS_ENVwheels env show --key=DEBUG_MODETips and Shortcuts
Section titled “Tips and Shortcuts”- Grouped display makes it easy to understand related configurations
- Security masking protects sensitive data during demos or screen sharing
- JSON output is perfect for automation and integration scripts
- Helpful error messages guide you when files are missing or keys don’t exist
- Project validation ensures you’re running the command in the right location
- Multiple file support lets you easily compare different environment configurations