This repository holds the CLI functionality for PHP.Gt/WebEngine, exposed via the gt command line.
The following commands are exposed:
gt add- add a page, API endpoint or cron script from a templategt create- create a new WebEngine applicationgt serve- run the inbuilt development servergt build- compile client-side assetsgt cron- invoke scripts or static functions at regular intervalsgt run- run all background scripts at once - a combination ofserve,build --watchandcron --watch --nowgt deploy- instantly deploy your application to the internet
Use gt add type name [template] to create new files in the current project.
Supported types:
pageapicron
Examples:
gt add page aboutgt add api usersgt add cron cleanupgt add page about multi-column
type and name are required. template is optional.
If no template name is provided, gt add copies the built-in templates from this package:
src/Template/page/template.html->page/<name>.htmlsrc/Template/page/template.php->page/<name>.phpsrc/Template/api/template.php->api/<name>.phpsrc/Template/api/template.json->api/<name>.jsonsrc/Template/cron/template.php->cron/<name>.php
If a template file contains {{name}}, it is replaced with the provided name.
If a template name is provided, files are loaded from the current working directory instead:
<type>/_template/<template>.*
For example:
gt add page about multi-column
This will copy:
page/_template/multi-column.html->page/about.htmlpage/_template/multi-column.php->page/about.php
The same lookup rule applies for api, cron, and future types that may be added later.