Skip to content

Quick start guide

Greg Bowler edited this page Apr 20, 2026 · 1 revision

In this guide we will create a small WebEngine application, add one page, and run it locally with the gt command.

Tip

If you are using WebEngine already, this guide is really a tour of the command-line workflow that the framework expects. The same gt command is how WebEngine exposes serving, building, cron, and migration tasks.

1. Make the command available

Most often, gt comes from the project itself or from a PHP.GT setup tool that places it on your shell PATH.

If you are working in a Composer project and gt is not available globally, use:

vendor/bin/gt help

Throughout the rest of this guide we will write gt ..., but vendor/bin/gt ... works in the same way.

2. Create a new application

gt create blog --namespace Blog

This command creates a new directory called blog, asks Composer to install a WebEngine blueprint into it, and then updates the project's dependencies.

If you leave out blog or --namespace Blog, the command will ask for them interactively.

3. Move into the project directory

cd blog

From this point on, gt works against the current project directory.

4. Add a page

gt add page about

That creates:

page/
├── about.html
└── about.php

The starter files come from this package's built-in templates. The HTML file contains a heading and paragraph, and the PHP file contains an empty go() function ready for page logic.

5. Run the project

gt run

By default, this starts the local web server and, where relevant, also starts the build watcher and cron watcher. The default URL is:

http://localhost:8080

Open that address in your browser and then visit /about to see the page you added.

6. Make another change

For example:

gt add api status
gt add cron cleanup

That gives you an API endpoint and a cron script scaffold using the same beginner-friendly workflow.

At that point you have the core shape of a PHP.GT command-line workflow: create a project, add files from templates, and run the local development processes through one command.


Next, move on to Adding files with gt add to see how templating and file generation work in more detail.