PHP.GT

Build, cron, and migrate commands

Several gt commands are thin wrappers around other PHP.GT packages. That is useful because it gives us one consistent command surface in WebEngine projects, even though the underlying work belongs to specialised components.

gt build

Basic usage:

gt build [--watch|-w] [--config|-c CONFIG] [--default|-d DEFAULT] [--mode|-m MODE]

Examples:

gt build
gt build --watch
gt build --mode production

This command delegates to the PHP.GT Build package.

In a WebEngine project, gt build also supplies a default build configuration path of:

vendor/phpgt/webengine/build.default.json

That means a project can often start using the build workflow without having to define every detail immediately.

For a full explanation of build configuration, modes, and watch behaviour, see the Build docs at https://www.php.gt/docs/build/.

gt cron

Basic usage:

gt cron [file] [--watch|-w] [--validate] [--now]

Examples:

gt cron
gt cron --watch
gt cron --validate

This command delegates to the PHP.GT Cron package.

Typical uses:

  • run any cron jobs that are due right now
  • keep a watcher running during local development
  • validate a crontab file without executing anything

If your project has a crontab file, gt run can start the watcher automatically.

For the full scheduling syntax and runtime behaviour, see the Cron docs at https://www.php.gt/docs/cron/.

gt migrate

Basic usage:

gt migrate [--base-directory BASE-DIRECTORY] [--driver DRIVER] [--database DATABASE] [--host HOST] [--port PORT] [--username USERNAME] [--password PASSWORD] [--force|-f] [--reset|-r RESET]

Examples:

gt migrate
gt migrate --force
gt migrate --reset 3

This command delegates to the PHP.GT Database migration command.

In WebEngine projects, this is the normal way to apply schema changes. It uses the project’s database configuration and migration files rather than requiring you to instantiate migration classes yourself.

Use it when you want to:

  • apply the next pending migrations
  • rebuild from the start with --force
  • reset the integrity marker to a specific migration with --reset

For the migration model, directory structure, and integrity checks, see:

gt deploy

gt deploy exists in the command list, but in this repository it is still a placeholder and does not perform deployment work yet.

It is worth documenting because users will see it in gt help, but for now it should be treated as not implemented.


If you want the whole command surface in one place, continue with Command reference.