1 # Drupal Code Generator
3 [![Build Status](https://travis-ci.org/Chi-teck/drupal-code-generator.svg?branch=master)](https://travis-ci.org/Chi-teck/drupal-code-generator)
5 A command line code generator for Drupal.
9 1. Download the latest [stable release](https://github.com/Chi-teck/drupal-code-generator/releases/latest) of the code generator.
10 2. Make the file executable.
11 3. Move it to a directory that is part of your `PATH`.
14 release_url=https://api.github.com/repos/chi-teck/drupal-code-generator/releases/latest
15 wget $(wget -qO- $release_url | awk -F'"' '/browser_download_url/ { print $4 }')
17 sudo mv dcg.phar /usr/local/bin/dcg
20 Installation using Composer is also supported.
23 Simply repeat installation commands.
30 # Display Drupal 8 submenu.
33 # Call generator directly.
34 dcg d8:plugin:field:widget
36 # Generate code non interactively.
37 dcg twig-extension -a '{"name": "Example", "machine_name": "example", "class": "ExampleTwigExtension"}'
40 All custom generators should be placed to _$HOME/.dcg/Command_ directory. The following command will help you to get started with creating own generators.
42 # Create custom DCG command.
43 dcg dcg-command -d $HOME/.dcg/Command
46 GNU General Public License, version 2 or later.