diff --git a/README.md b/README.md index e4d5f70..dcea096 100644 --- a/README.md +++ b/README.md @@ -5,6 +5,7 @@ This repository holds the CLI functionality for [PHP.Gt/WebEngine](https://www.p The following commands are exposed: ++ `gt add` - add a page, API endpoint or cron script from a template + `gt create` - create a new WebEngine application + `gt serve` - run the inbuilt development server + `gt build` - compile client-side assets @@ -12,6 +13,54 @@ The following commands are exposed: + `gt run` - run all background scripts at once - a combination of `serve`, `build --watch` and `cron --watch --now` + `gt deploy` - instantly deploy your application to the internet +## `gt add` + +Use `gt add type name [template]` to create new files in the current project. + +Supported types: + ++ `page` ++ `api` ++ `cron` + +Examples: + ++ `gt add page about` ++ `gt add api users` ++ `gt add cron cleanup` ++ `gt add page about multi-column` + +`type` and `name` are required. `template` is optional. + +### Built-in templates + +If no template name is provided, `gt add` copies the built-in templates from this package: + ++ `src/Template/page/template.html` -> `page/.html` ++ `src/Template/page/template.php` -> `page/.php` ++ `src/Template/api/template.php` -> `api/.php` ++ `src/Template/api/template.json` -> `api/.json` ++ `src/Template/cron/template.php` -> `cron/.php` + +If a template file contains `{{name}}`, it is replaced with the provided `name`. + +### Project templates + +If a template name is provided, files are loaded from the current working directory instead: + ++ `/_template/