LogoLogo
HomeAPIBlog
3.0.0-SNAPSHOT
3.0.0-SNAPSHOT
  • INTRODUCTION
    • Getting Started
      • Running Local Development Servers
      • Beginner Tutorial: Hello World
      • Beginner Tutorial: Hello Database
      • Tutorial: Wheels, AJAX, and You
    • Frameworks and Wheels
    • Requirements
    • Manual Installation
    • Upgrading
    • Screencasts
  • Command Line Tools
    • CLI Overview
    • Quick Start Guide
    • Command Reference
      • Core Commands
        • wheels init
        • wheels info
        • wheels reload
        • wheels deps
        • wheels destroy
        • wheels watch
      • Code Generation
        • wheels generate app
        • wheels generate app-wizard
        • wheels generate controller
        • wheels generate model
        • wheels generate view
        • wheels generate property
        • wheels generate route
        • wheels generate resource
        • wheels generate api-resource
        • wheels generate frontend
        • wheels generate test
        • wheels generate snippets
        • wheels scaffold
      • Database Commands
        • wheels dbmigrate info
        • wheels dbmigrate latest
        • wheels dbmigrate up
        • wheels dbmigrate down
        • wheels dbmigrate reset
        • wheels dbmigrate exec
        • wheels dbmigrate create blank
        • wheels dbmigrate create table
        • wheels dbmigrate create column
        • wheels dbmigrate remove table
        • wheels db schema
        • wheels db seed
      • Testing Commands
        • wheels test
        • wheels test run
        • wheels test coverage
        • wheels test debug
      • Configuration Commands
        • wheels config list
        • wheels config set
        • wheels config env
      • Environment Management
        • wheels env
        • wheels env setup
        • wheels env list
        • wheels env switch
      • Plugin Management
        • wheels plugins
        • wheels plugins list
        • wheels plugins install
        • wheels plugins remove
      • Code Analysis
        • wheels analyze
        • wheels analyze code
        • wheels analyze performance
        • wheels analyze security
      • Security Commands
        • wheels security
        • wheels security scan
      • Performance Commands
        • wheels optimize
        • wheels optimize performance
      • Documentation Commands
        • wheels docs
        • wheels docs generate
        • wheels docs serve
      • CI/CD Commands
        • wheels ci init
      • Docker Commands
        • wheels docker init
        • wheels docker deploy
      • Deployment Commands
        • wheels deploy
        • wheels deploy audit
        • wheels deploy exec
        • wheels deploy hooks
        • wheels deploy init
        • wheels deploy lock
        • wheels deploy logs
        • wheels deploy proxy
        • wheels deploy push
        • wheels deploy rollback
        • wheels deploy secrets
        • wheels deploy setup
        • wheels deploy status
        • wheels deploy stop
    • CLI Development Guides
      • Creating Commands
      • Service Architecture
      • Migrations Guide
      • Testing Guide
  • Working with Wheels
    • Conventions
    • Configuration and Defaults
    • Directory Structure
    • Switching Environments
    • Testing Your Application
    • Using the Test Environment
    • Contributing to Wheels
    • Submitting Pull Requests
    • Documenting your Code
  • Handling Requests with Controllers
    • Request Handling
    • Rendering Content
    • Redirecting Users
    • Sending Files
    • Sending Email
    • Responding with Multiple Formats
    • Using the Flash
    • Using Filters
    • Verification
    • Event Handlers
    • Routing
    • URL Rewriting
      • Apache
      • IIS
      • Tomcat
      • Nginx
    • Obfuscating URLs
    • Caching
    • Nesting Controllers
    • CORS Requests
  • Displaying Views to Users
    • Pages
    • Partials
    • Linking Pages
    • Layouts
    • Form Helpers and Showing Errors
    • Displaying Links for Pagination
    • Date, Media, and Text Helpers
    • Creating Custom View Helpers
    • Localization
  • Database Interaction Through Models
    • Object Relational Mapping
    • Creating Records
    • Reading Records
    • Updating Records
    • Deleting Records
    • Column Statistics
    • Dynamic Finders
    • Getting Paginated Data
    • Associations
    • Nested Properties
    • Object Validation
    • Object Callbacks
    • Calculated Properties
    • Transactions
    • Dirty Records
    • Soft Delete
    • Automatic Time Stamps
    • Database Migrations
      • Migrations in Production
    • Using Multiple Data Sources
  • Plugins
    • Installing and Using Plugins
    • Developing Plugins
    • Publishing Plugins
  • Project Documentation
    • Overview
  • External Links
    • Source Code
    • Issue Tracker
    • Sponsor Us
    • Community
Powered by GitBook
LogoLogo
On this page
  • Synopsis
  • Description
  • Arguments
  • Options
  • Examples
  • Set basic configuration
  • Set with specific type
  • Set for specific environment
  • Set complex value
  • Delete configuration
  • Set encrypted value
  • Configuration Types
  • String Values
  • Boolean Values
  • Numeric Values
  • JSON/Complex Values
  • Where Settings Are Saved
  • Environment-Specific
  • Global Settings
  • Environment Variables
  • Value Type Detection
  • Sensitive Values
  • Automatic Encryption
  • Manual Encryption
  • Encrypted Storage
  • Validation
  • Interactive Mode
  • Batch Operations
  • From File
  • Multiple Values
  • Configuration Precedence
  • Rollback
  • Create Backup
  • Restore
  • Special Keys
  • Reserved Keys
  • Computed Keys
  • Environment Variables
  • Set as Environment Variable
  • Export Format
  • Validation Rules
  • Key Naming
  • Value Constraints
  • Best Practices
  • Advanced Usage
  • Conditional Setting
  • Template Variables
  • Troubleshooting
  • Permission Denied
  • Setting Not Taking Effect
  • Invalid Value
  • Integration
  • CI/CD Pipeline
  • Docker
  • Notes
  • See Also

Was this helpful?

Edit on GitHub
Export as PDF
  1. Command Line Tools
  2. Command Reference
  3. Configuration Commands

wheels config set

Set configuration values for your Wheels application.

Synopsis

wheels config set [key] [value] [options]

Description

The wheels config set command updates configuration settings in your Wheels application. It can modify settings in configuration files, set environment-specific values, and manage runtime configurations.

Arguments

Argument
Description
Required

key

Configuration key to set

Yes

value

Value to set

Yes (unless --delete)

Options

Option
Description
Default

--environment

Target environment

Current

--global

Set globally across all environments

false

--file

Configuration file to update

Auto-detect

--type

Value type (string, number, boolean, json)

Auto-detect

--encrypt

Encrypt sensitive values

Auto for passwords

--delete

Delete the configuration key

false

--force

Overwrite without confirmation

false

--help

Show help information

Examples

Set basic configuration

wheels config set dataSourceName wheels_production

Set with specific type

wheels config set cacheQueries true --type=boolean
wheels config set sessionTimeout 3600 --type=number

Set for specific environment

wheels config set showDebugInformation false --environment=production

Set complex value

wheels config set cacheSettings '{"queries":true,"pages":false}' --type=json

Delete configuration

wheels config set oldSetting --delete

Set encrypted value

wheels config set apiKey sk_live_abc123 --encrypt

Configuration Types

String Values

wheels config set appName "My Wheels App"
wheels config set emailFrom "noreply@example.com"

Boolean Values

wheels config set showDebugInformation true
wheels config set cacheQueries false

Numeric Values

wheels config set sessionTimeout 1800
wheels config set maxUploadSize 10485760

JSON/Complex Values

wheels config set mailSettings '{"server":"smtp.example.com","port":587}'
wheels config set allowedDomains '["example.com","app.example.com"]'

Where Settings Are Saved

Environment-Specific

Default location: /config/[environment]/settings.cfm

// Added to /config/production/settings.cfm
set(dataSourceName="wheels_production");

Global Settings

Location: /config/settings.cfm

wheels config set defaultLayout "main" --global

Environment Variables

For system-level settings:

wheels config set DATABASE_URL "mysql://..." --env-var

Value Type Detection

The command auto-detects types:

  • true/false → boolean

  • Numbers → numeric

  • JSON syntax → struct/array

  • Default → string

Override with --type:

wheels config set port "8080" --type=string

Sensitive Values

Automatic Encryption

These patterns trigger encryption:

  • *password*

  • *secret*

  • *key*

  • *token*

Manual Encryption

wheels config set customSecret "value" --encrypt

Encrypted Storage

// Stored as:
set(apiKey=decrypt("U2FsdGVkX1+..."));

Validation

Before setting, validates:

  1. Key name syntax

  2. Value type compatibility

  3. Environment existence

  4. File write permissions

Interactive Mode

For sensitive values:

wheels config set reloadPassword
# Enter value (hidden): ****
# Confirm value: ****

Batch Operations

From File

# config.txt
dataSourceName=wheels_prod
cacheQueries=true
sessionTimeout=3600

wheels config set --from-file=config.txt

Multiple Values

wheels config set \
  dataSourceName=wheels_prod \
  cacheQueries=true \
  sessionTimeout=3600

Configuration Precedence

Order of precedence (highest to lowest):

  1. Runtime set() calls

  2. Environment variables

  3. Environment-specific settings

  4. Global settings

  5. Framework defaults

Rollback

Create Backup

wheels config set dataSourceName wheels_new --backup
# Creates: .wheels-config-backup-20240115-103045

Restore

wheels config restore --from=.wheels-config-backup-20240115-103045

Special Keys

Reserved Keys

Some keys have special behavior:

  • environment - Switches environment

  • reloadPassword - Always encrypted

  • dataSourcePassword - Hidden in output

Computed Keys

Some settings affect others:

wheels config set environment production
# Also updates: debug settings, cache settings

Environment Variables

Set as Environment Variable

wheels config set WHEELS_DATASOURCE wheels_prod --env-var

Export Format

wheels config set --export-env > .env

Validation Rules

Key Naming

  • Alphanumeric and underscores

  • No spaces or special characters

  • Case-sensitive

Value Constraints

# Validates port range
wheels config set port 80000 --type=number
# Error: Port must be between 1-65535

# Validates boolean
wheels config set cacheQueries maybe --type=boolean
# Error: Value must be true or false

Best Practices

  1. Use Correct Types: Specify type for clarity

  2. Environment-Specific: Don't set production values globally

  3. Encrypt Secrets: Always encrypt sensitive data

  4. Backup First: Create backups before changes

  5. Document Changes: Add comments in config files

Advanced Usage

Conditional Setting

# Set only if not exists
wheels config set apiUrl "https://api.example.com" --if-not-exists

# Set only if current value matches
wheels config set cacheQueries true --if-value=false

Template Variables

wheels config set dbName "wheels_${ENVIRONMENT}" --parse-template

Troubleshooting

Permission Denied

  • Check file write permissions

  • Run with appropriate user

  • Verify directory ownership

Setting Not Taking Effect

  • Restart application

  • Clear caches

  • Check precedence order

Invalid Value

  • Verify type compatibility

  • Check for typos

  • Review validation rules

Integration

CI/CD Pipeline

- name: Configure production
  run: |
    wheels config set environment production
    wheels config set dataSourceName ${{ secrets.DB_NAME }}
    wheels config set reloadPassword ${{ secrets.RELOAD_PASS }}

Docker

RUN wheels config set dataSourceName ${DB_NAME} \
    && wheels config set cacheQueries true

Notes

  • Some settings require application restart

  • Encrypted values can't be read back

  • Changes are logged for audit

  • Use environment variables for containers

See Also

Previouswheels config listNextwheels config env

Last updated 2 days ago

Was this helpful?

- List configuration

- Environment config

- Environment management

wheels config list
wheels config env
wheels env
Configuration Guide