Framework commands
Run Drush, Artisan, WP-CLI or the PrestaShop console through the Tilizy CLI, locally or on a hosted environment.
On this page
Your framework has its own command-line tool: Drush for Drupal, Artisan for Laravel, WP-CLI for WordPress, the console for PrestaShop. The Tilizy CLI runs that tool for you inside the right environment, with the right PHP version and the right settings, on your computer or on a hosted environment. You do not install the tool on your own machine.
Which command you get
The framework key in .tilizy/app.yaml decides which command the CLI offers in that checkout.
| Framework | Command | Short form | What it runs |
|---|---|---|---|
| Drupal | tilizy drupal:drush | tilizy drush | The Drush that your project installs with Composer |
| Laravel | tilizy laravel:artisan | tilizy artisan | php artisan |
| WordPress | tilizy wordpress:wp | tilizy wp | wp (WP-CLI) |
| PrestaShop | tilizy prestashop:console | tilizy console | php bin/console |
Inside a checkout, tilizy --help lists the commands of your framework in a group of their own.
Run a command locally
Without a flag, the command runs in the copy on your computer. Everything after the command name is passed to the tool unchanged.
tilizy drush status
tilizy artisan migrate:status
tilizy wp plugin list
tilizy console cache:clear
The output is the output of the tool itself.
Run a command on a hosted environment
Add an environment flag. It can stand anywhere before a -- separator:
tilizy drush status --staging
tilizy artisan migrate:status -e feature-checkout
tilizy wp plugin list --prod
Before the tool runs, the CLI prints a line that names the environment, so a command on live is never silent.
Warning: With --prod the command runs on your live website at once. There is no second confirmation. Changes that belong in a release, such as database updates and configuration, should go out with a deploy, not by hand.
Outside a checkout, name the project and the environment. There is no default environment in this case:
tilizy drush -p <project> --prod status
Which words the CLI keeps for itself
-e,--environment,-p,--project,--prod,--stagingand--no-inputare read by the CLI and not passed on.- Everything else goes to the tool as you typed it, including its own options:
tilizy drush updatedb -y. - Anything after
--is never read by the CLI. Use it when an argument of the tool looks like one of the flags above. --helpdirectly after the command name shows the help of the CLI:tilizy drush --help. Further along it shows the help of the tool:tilizy drush status --help.
Commands that build
The running website sees its code as read-only. A command of your framework that writes into the code, such as an asset build, cannot run there.
- Locally, run it in the build container:
tilizy app:exec --build <command>. Some build commands are sent there automatically, and the CLI then prints a line that says so. - On a hosted environment, such commands are refused. A release cannot be changed after it is built. Put the step into
hooks.buildand deploy.
More commands for Drupal
| Command | What it does |
|---|---|
tilizy drupal:login | Opens your local website in the browser, signed in as an administrator, through a one-time link. --name or --uid choose another user. |
tilizy drupal:config:status | Compares the configuration that is active on live with the configuration in your repository, and lists what really differs. It changes nothing. --exit-code makes it fail when there are differences, for use in a script. |
tilizy drupal:config:pull | Writes those differences into the configuration folder of your checkout and stages them in Git for you to review and commit. --diff-only only shows them. --no-stage writes without staging. |
Both configuration commands look at live unless you pass -e <branch> or --staging. Run drupal:config:status before a deploy: a configuration import replaces live configuration with what is in the repository, and a setting changed on the live site would be lost.
Composer and PHP
Composer and PHP are available for the copy on your computer:
tilizy app:composer require vendor/package
tilizy app:php -v
These two, and tilizy app:build, pass every argument on unchanged. Do not add --no-input to them in a script. Set TILIZY_NO_INPUT=1 instead.
What can go wrong
- "Unknown command" for
drush,artisan,wporconsole. You are not inside a checkout, theframeworkkey names another framework, or the project file cannot be read. In the last case the CLI prints a warning that names the file and the error. - The command ran locally, not on live. Without a flag the target is always the copy on your computer.
-palone does not change that: add--prod,--stagingor-e <branch>. - WP-CLI is not found. The CLI runs
wpinside the environment, so WP-CLI must be available there. - Two environment flags. Use only one of
-e,--prodand--staging.
Next: The command reference and Run your website locally.