CLI Overview
Quick Start Guide
wheels info
wheels reload
wheels deps
wheels destroy
wheels watch
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
wheels db create
wheels db drop
wheels db setup
wheels db reset
wheels db status
wheels db version
wheels db rollback
wheels db seed
wheels db dump
wheels db restore
wheels db shell
wheels db schema
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 test
wheels test run
wheels test coverage
wheels test debug
wheels config list
wheels config set
wheels config env
wheels env
wheels env setup
wheels env list
wheels env switch
wheels environment
wheels console
wheels runner
wheels server
wheels server start
wheels server stop
wheels server restart
wheels server status
wheels server log
wheels server open
wheels plugins
wheels plugins list
wheels plugins install
wheels plugins remove
wheels analyze
wheels analyze code
wheels analyze performance
wheels analyze security
wheels security
wheels security scan
wheels optimize
wheels optimize performance
wheels docs
wheels docs generate
wheels docs serve
wheels ci init
wheels docker init
wheels docker deploy
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
Configuration Management
Creating Commands
Service Architecture
Migrations Guide
Testing Guide
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
Using Multiple Data Sources
wheels generate app
This command works correctly without options (parameters). Option support is under development and will be available soon.
Create a new Wheels application from templates.
Synopsis
wheels generate app [name] [template] [directory] [options]
wheels g app [name] [template] [directory] [options]
wheels new [name] [template] [directory] [options]
Description
The wheels generate app
command creates a new Wheels application with a complete directory structure, configuration files, and optionally sample code. It supports multiple templates for different starting points.
Arguments
| Argument | Description | Default |
|----------|-------------|---------|
| name
| Application name | MyApp
|
| template
| Template to use | wheels-base-template@BE
|
| directory
| Target directory | ./{name}
|
Options
| Option | Description | Default |
|--------|-------------|---------|
| reloadPassword
| Set reload password | ''
(empty) |
| datasourceName
| Database datasource name | App name |
| cfmlEngine
| CFML engine (lucee/adobe/boxlang) | lucee
|
| --useBootstrap
| Include Bootstrap CSS | false
|
| --setupH2
| Setup H2 embedded database | true
|
| --init
| Initialize as CommandBox package | false
|
| --force
| Overwrite existing directory | false
|
| --help
| Show help information | |
Available Templates
wheels-base-template@BE (Default)
wheels generate app myapp
- Backend Edition template
- Complete MVC structure
- Sample code and configuration
- H2 database setup by default
HelloWorld
wheels generate app myapp HelloWorld
- Simple "Hello World" example
- One controller and view
- Great for learning
HelloDynamic
wheels generate app myapp HelloDynamic
- Dynamic content example
- Database interaction
- Form handling
HelloPages
wheels generate app myapp HelloPages
- Static pages example
- Layout system
- Navigation structure
Examples
Create basic application
wheels generate app blog
Create with custom template
wheels generate app api Base@BE
Create in specific directory
wheels generate app name=myapp directory=./projects/
Create with Bootstrap
wheels generate app portfolio --useBootstrap
Create with H2 database (default is true)
wheels generate app demo --setupH2
Create with all options
wheels generate app name=enterprise template=HelloDynamic directory=./apps/ \
reloadPassword=secret \
datasourceName=enterprise_db \
cfmlEngine=adobe \
--useBootstrap \
--setupH2
Generated Structure
myapp/
├── .wheels-cli.json # CLI configuration
├── box.json # Dependencies
├── server.json # Server configuration
├── Application.cfc # Application settings
├── config/
│ ├── app.cfm # App configuration
│ ├── routes.cfm # URL routes
│ └── settings.cfm # Framework settings
├── controllers/
│ └── Main.cfc # Default controller
├── models/
├── views/
│ ├── layout.cfm # Default layout
│ └── main/
│ └── index.cfm # Home page
├── public/
│ ├── stylesheets/
│ ├── javascripts/
│ └── images/
├── tests/
└── wheels/ # Framework files
Configuration Files
box.json
{
"name": "myapp",
"version": "1.0.0",
"dependencies": {
"wheels": "^2.5.0"
}
}
server.json
{
"web": {
"http": {
"port": 3000
}
},
"app": {
"cfengine": "lucee5"
}
}
.wheels-cli.json
{
"name": "myapp",
"version": "1.0.0",
"framework": "wheels",
"reload": "wheels"
}
Database Setup
With H2 (Embedded)
wheels generate app myapp
- H2 is setup by default (--setupH2=true)
- No external database needed
- Perfect for development
- Auto-configured datasource
- To disable:
--setupH2=false
With External Database
-
Create application:
wheels generate app myapp datasourceName=myapp_db --setupH2=false
-
Configure in CommandBox:
server set app.datasources.myapp_db={...}
Post-Generation Steps
-
Navigate to directory
cd myapp
-
Install dependencies
box install
-
Start server
box server start
-
Open browser
http://localhost:3000
Template Development
Create custom templates in ~/.commandbox/cfml/modules/wheels-cli/templates/apps/
:
mytemplate/
├── config/
├── controllers/
├── models/
├── views/
└── template.json
Best Practices
- Use descriptive application names
- Choose appropriate template for project type
- Set secure reload password for production
- Configure datasource before starting
- Run tests after generation
Common Issues
- Directory exists: Use
--force
or choose different name - Template not found: Check available templates with
wheels info
- Datasource errors: Configure database connection
- Port conflicts: Change port in
server.json
See Also
- wheels init - Initialize existing application
- wheels generate app-wizard - Interactive app creation
- wheels scaffold - Generate CRUD scaffolding
- Synopsis
- Arguments
- Options
- Available Templates
- wheels-base-template@BE (Default)
- HelloWorld
- HelloDynamic
- HelloPages
- Examples
- Create basic application
- Create with custom template
- Create in specific directory
- Create with Bootstrap
- Create with H2 database (default is true)
- Create with all options
- Generated Structure
- Configuration Files
- box.json
- server.json
- .wheels-cli.json
- Database Setup
- With H2 (Embedded)
- With External Database
- Post-Generation Steps
- Template Development
- Best Practices
- Common Issues
- See Also