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]CommandBox Parameter Syntax
This command supports multiple parameter formats:
Positional parameters:
wheels generate app blog(most common)Named parameters:
name=value(e.g.,name=blog,template=HelloWorld)Flag parameters:
--flagequalsflag=true(e.g.,--useBootstrapequalsuseBootstrap=true)
Parameter Mixing Rules:
ALLOWED:
All positional:
wheels generate app blogAll positional + flags:
wheels generate app blog --useBootstrap --initAll named:
name=blog template=HelloWorld --useBootstrap
NOT ALLOWED:
Positional + named:
wheels generate app blog name=myapp(causes error)
Recommendation: Use positional for name/template, flags for options: wheels generate app blog --useBootstrap --init
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
name
Application name
MyApp
template
Template to use
wheels-base-template@BE
directory
Target directory
./{name}
Options
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
Available Templates
wheels-base-template@BE (Default)
wheels generate app myappBackend Edition template
Complete MVC structure
Sample code and configuration
H2 database setup by default
HelloWorld
wheels generate app myapp HelloWorldSimple "Hello World" example
One controller and view
Great for learning
HelloDynamic
wheels generate app myapp HelloDynamicDynamic content example
Database interaction
Form handling
HelloPages
wheels generate app myapp HelloPagesStatic pages example
Layout system
Navigation structure
Examples
Create basic application
# Positional (recommended)
wheels generate app blog
# OR all named
wheels g app name=blogCreate in specific directory
# Positional + named (recommended)
wheels generate app myapp --directory=./projects/Create with Bootstrap
# Positional + flag (recommended)
wheels generate app portfolio --useBootstrapCreate with H2 database (default is true)
# Positional + flag (recommended)
wheels generate app demo --setupH2Create with all options
# Positional + flags (recommended)
wheels generate app enterprise --template=HelloDynamic --directory=./apps/ --reloadPassword=secret --datasourceName=enterprise_db --cfmlEngine=adobe --useBootstrap --setupH2Generated Structure
myapp/
├── .gitignore # Github gitignore file
├── box.json # Dependencies
├── server.json # Server configuration
├── README.md # Description about application
├── config/
│ ├── development/
│ │ └── settings.cfm # Environment specific settings
│ ├── maintenance/
│ │ └── settings.cfm # Environment specific settings
│ ├── production/
│ │ └── settings.cfm # Environment specific settings
│ ├── testing/
│ │ └── settings.cfm # Environment specific settings
│ ├── app.cfm # App configuration
│ ├── routes.cfm # URL routes
│ ├── environment.cfm # Environment
│ └── settings.cfm # Framework settings
├── app/
│ ├── controllers/
│ │ └── Controller.cfc # Default controller
│ ├── events/ # Default event handlers
│ ├── migrator/ # Contains migrations
│ ├── models/
│ │ └── Model.cfc # Default model
│ ├── snippets/
│ ├── views/
│ │ ├── helpers.cfm # Default helpers
│ │ └── layout.cfm # Default layout
├── public/
│ ├── files/
│ ├── stylesheets/
│ ├── javascripts/
│ ├── images/
│ ├── miscellaneous/
│ ├── Application.cfc # Application settings
│ ├── index.cfm # Home page
│ └── urlrewrite.xml
├── plugins/
├── tests/
└── vendor/ # Framework files
├── testbox/
├── wheels/
└── wirebox/Configuration Files
box.json
{
"name": "myapp",
"version": "1.0.0",
"author": "Wheels Core Team and Community",
"installPaths": {
"wheels-core": "vendor/wheels/",
"wirebox": "vendor/wirebox/",
"testbox": "vendor/testbox/"
},
"dependencies": {
"wheels-core": "3.0.0",
"wirebox": "^7",
"testbox": "^6",
}
}server.json
{
"name":"myapp",
"web":{
"host":"localhost",
"webroot":"public",
"rewrites":{
"enable":true,
"config":"public/urlrewrite.xml"
}
},
"app":{
"cfengine":"lucee",
"libDirs":"app/lib"
}
}Configure Custom Port in server.json
{
"web": {
"http": {
"enable":true,
"port":"3000"
}
}
}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
--forceor choose different nameTemplate not found: Check available templates with
wheels infoDatasource 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
Last updated
Was this helpful?

