Creating a new WebEngine application
gt create starts a complete WebEngine application from a blueprint. It is the fastest way to go from an empty directory to a runnable project.
Basic usage
gt create [projectName] [--namespace|-n NAMESPACE] [--blueprint|-b BLUEPRINT] [--empty|-e]
Example:
gt create blog --namespace Blog --blueprint hello-world
If projectName, --namespace, or --blueprint are omitted, the command can ask for them interactively.
If you want the minimal project scaffold, --empty is a shortcut for --blueprint empty and forces the namespace to App.
Example:
gt create blog --empty
Step by step
Internally, the command:
- validates the project directory name
- validates the PHP namespace
- chooses a blueprint
- runs
composer create-projectfor that blueprint - runs
composer updateinside the new project directory - offers to run the new application immediately
That means the command is more than a file copier: it is a guided project bootstrap process.
Available blueprints
At the time of writing, the built-in blueprint list is:
emptyhello-worldhello-youtodo-list- More coming soon…
These are shown interactively with titles and descriptions if you do not pass --blueprint.
If you know you want the empty blueprint, --empty is a synonym for --blueprint empty.
Choosing a project name
The project name becomes the directory name created in the current working directory.
Valid names may contain:
- letters
- numbers
- underscores
- hyphens
If a file or directory with that name already exists, the command stops before doing any work.
Choosing a namespace
The namespace is the root PHP namespace for the generated application.
Example:
gt create blog --namespace Blog
That keeps the project’s classes under Blog\... rather than a generic default.
If you omit the namespace interactively, the command suggests App.
If you pass --empty, the namespace is set to App even if --namespace is also provided.
Running the new application straight away
After the blueprint has been installed successfully, gt create asks whether you would like to run the new application immediately.
If you answer yes, it changes into the new project directory and runs the same local development flow as gt run.
If you answer no, it leaves the new application on disk and prints the WebEngine getting-started link.
When to use a blueprint
Blueprints are most useful when:
- you are learning WebEngine and want a working example to start from
- your team has settled on a common starting point for new applications
- you want a more guided introduction than a completely empty project gives
The empty blueprint is a good option when you want the framework structure without any extra demonstration code.
To see what happens after the project is created, move on to Running a project locally.