The qt command-line tool does more than run the local server. It also helps generate and publish project structure, migration files, environment files, application keys, and OpenAPI assets.
From the current upstream command set, qt can help create or publish things such as:
- new modules from templates
- new migration files
- a local
.envfile from.env.example - an application key stored in
.env - OpenAPI UI resources and OpenAPI specification files
- DebugBar assets
So code generation in Quantum is broader than only scaffolding code files. It also includes project setup and generated project resources.
The main scaffolding command is:
php qt module:generate BlogThis command creates a new module using a template.
From the upstream ModuleGenerateCommand, it accepts:
- a required module name argument
--templateor-t--yesor-y--with-assetsor-a
A more explicit example looks like:
php qt module:generate Blog --template=DefaultWeb --with-assetsFrom the upstream ModuleManager, module generation does real framework work, not just file copying.
It:
- ensures the
modules/directory exists - loads files from a module template
- processes template placeholders such as module namespace and module name
- writes the generated files into
modules/<ModuleName>/ - optionally copies template assets into the assets directory
- updates
shared/config/modules.php
So this command is important because it creates a framework-ready module and also registers it in project configuration.
From the current upstream core templates, the available module templates are:
DefaultApiDefaultWebDemoApiDemoWebToolkit
This matters because module:generate is not one fixed scaffold. The template changes what kind of module structure you start with.
Depending on the selected template, a generated module can include things such as:
- controllers
- routes
- middlewares
- views
- services
- other module files
- optional assets when
--with-assetsis used
So module generation is the real center of scaffolding in Quantum right now.
Another generation command is:
php qt migration:generate create postsFrom the upstream MigrationGenerateCommand, this command requires:
- an action
- a table name
The supported action flow is described in the command as:
createalterrenamedrop
So another valid example would be:
php qt migration:generate alter postsThis command creates a new migration file through MigrationManager.
Its job is focused and specific:
- generate the migration file name
- create a new migration file for the given action and table
That makes it part of Quantum's code generation story, even though it is more narrow than module scaffolding.
Quantum also includes:
php qt core:envFrom the upstream EnvCommand, this command:
- checks for
.env.example - copies
.env.exampleto.env - can ask for confirmation before overwriting an existing
.env
So this is also part of the generation story, because it creates a real project file needed for local setup.
Quantum also includes:
php qt core:keyFrom the upstream KeyGenerateCommand, this command:
- generates a random application key
- writes it into the
APP_KEYrow in.env - can ask for confirmation before replacing an existing key
This is another example where qt generates project state, not just source files.
Quantum also includes:
php qt install:openapi ApiFrom the upstream OpenApiCommand, this command can:
- publish OpenAPI UI resources into the public assets directory
- update the target module routes for OpenAPI endpoints when needed
- create the module
resources/openapi/directory - generate an OpenAPI
spec.jsonfile from controller annotations
So qt is also able to generate API documentation resources, not only application scaffolding.
Quantum also includes:
php qt install:debugbarThis publishes the DebugBar resource files into the public assets directory so the toolbar can render correctly in a project that uses it.
The current built-in command set does not show separate generators like:
controller:generatemiddleware:generateview:generate
Those parts are usually introduced through module templates instead of individual generator commands.
Even with a smaller command set, generation is still valuable because it helps create Quantum-aligned structure.
The main benefits are:
- faster project setup
- less manual boilerplate
- template-based module structure
- consistent migration file creation
- generated environment and key setup
- generated OpenAPI resources and specs
- automatic module config updates
A normal flow can look like this:
- generate
.envwithphp qt core:env - generate an app key with
php qt core:key - generate a module
- inspect the generated controllers, routes, middlewares, and views
- edit the generated files for your feature
- generate migrations as the database changes
- run migrations with
php qt migration:migrate - publish OpenAPI resources when needed
These pages fit well with code generation: