There are different ways to get the project on your local machine. Our recommendation for getting the project on your local machine is by using the installer.
You can install the Drupal Console locally by running the installer in your project directory, the installer will take care of downloading the necesary files to run drupal console on you computer.
$ curl https://drupalconsole.com/installer -L -o drupal.phar
php -r "readfile('https://drupalconsole.com/installer');" > drupal.phar
$ php console.phar generate:module
You can place this file anywhere you wish. If you put it in your PATH, you can access it globally. On unixy systems you can even make it executable and invoke it without php.
$ mv console.phar /usr/local/bin/drupal
$ chmod +x /usr/local/bin/drupal
$ drupal
NOTE: The name drupal
is just an alias you can name it
anything you like.
You can install this project using composer.
$ composer global require drupal/console:@stable
$ echo "PATH=$PATH:~/.composer/vendor/bin" >> ~/.bash_profile
$ console generate:module
You can download the latest version of Console from the repository releases page at:
https://github.com/hechoendrupal/DrupalConsole
Make sure you download the console.phar file from the most current release.
Drupal 8 is under heavy development, to keep in sync with the latest changes. The easiest and recommended way of updating Drupal Console is using the self-update command.
$ drupal self-update
$ composer global update drupal/console:@stable
$ php console.phar self-update
Note: Drupal Console commands *must* be run from the root of a Drupal 8 installation.
Drupal Console Command | Details |
---|---|
{{ namespace }} | |
{{ command.name }} | {{ command.description }} |
Option | Details |
---|---|
{{ option.name }} | {{ option.description }} |
Argument | Details |
---|---|
{{ argument.name }} | {{ argument.description }} |