SlideShare a Scribd company logo
Faster	and	Smarter
Development	with	Drupal
Console
Jesus	Manuel	Olivas
Drupal	8	Solutions	Engineer
	|	
	
I	work	for	FFW
(and	you	should	too)
About	me
@jmolivas @drupalconsole
@drupodcast
What	is	the	Drupal	Console?
It	is	a	suite	of	tools	that	you	run	on	a
command	line	interface	(CLI)	to	generate
boilerplate	code	and	interact	with	a	Drupal	8
installation.
David	Flores	|	@dmouse
Eduardo	García	|	@enzolutions
Jesús	Manuel	Olivas	|	@jmolivas
Omar	Aguirre	|	@omers
Who	maintain	this	project?
Supporting	organizations
Why	should	you	care	about	it?
Drupal	is	more	tehcnically	advanced
How	does	Drupal	Console	help?
Topics
Where	to	find	and	how	to	Download	Drupal
Console
Generate	code/files	required	by	a	Drupal	8	module.
Interact	with	your	Drupal	8	installation.
Learn	Drupal	8.
Write	an	integration.
Automate	command	execution.
Remote	command	execution.
Contribute	to	the	project	and	Roadmap.
Where	do	you	 nd	the	project?
Landing	Page
Documentation
Support
http://drupalconsole.com/
http://bit.ly/console-book
http://bit.ly/console-support
Download	Drupal	Console
Using	the	Installer
Install	the	Console	locally	by	running	the	installer	
in	your	project	directory:
$ curl http://drupalconsole.com/installer | php
$ mv console.phar /usr/local/bin/drupal
$ drupal
Faster and Smarter Development with Drupal Console
Using	Composer
$ composer global require drupal/console:@stable
# download at:
# ~/.composer/vendor/drupal/console
# run it using:
$ ~/.composer/vendor/bin/console
Gitbook	-	Using	Composer
Using	Drupal	Composer
$ composer create-project
drupal-composer/drupal-project:8.x-dev
drupal8.dev
--stability dev
--no-interaction
https://github.com/drupal-composer/drupal-project
Using	a	Virtual	Machine
DrupalVM
A	VM	for	local	Drupal	development
Drupal	8	Sprint	Box
Simple	Drupal	8	Development	Environment
http://www.drupalvm.com/
https://github.com/thom8/drupal8-vagrant
Updating	the	project
Depending	on	the	download	method:
$ drupal self-update
$ console self-update
$ php console.phar self-update
Copy	con guration	 les
$ drupal init
# ~/.console/config.yml
# ~/.console/chain/sample.yml
Generate	the	code	and	 les
required	by	a	Drupal	8	module.
generate:module
Faster and Smarter Development with Drupal Console
generate:controller
Faster and Smarter Development with Drupal Console
Faster and Smarter Development with Drupal Console
Faster and Smarter Development with Drupal Console
generate:form:con g
Faster and Smarter Development with Drupal Console
example.routing.yml
src/Form/ExampleForm.php
src/Form/ExampleForm.php
src/Form/ExampleForm.php
generate:plugin:block
$ drupal generate:plugin:block
--module="example"
--class-name="ExampleBlock"
--label="example_block"
--plugin-id="example_block"
--no-interaction
Faster and Smarter Development with Drupal Console
Faster and Smarter Development with Drupal Console
generate:entity:content
$ drupal generate:entity:content
--module="example"
--entity-class="Foo"
--entity-name="foo"
--no-interaction
Faster and Smarter Development with Drupal Console
Other	generators
generate:authentication:provider
generate:entity:config
generate:event:subscriber
generate:permissions
generate:plugin:field
generate:plugin:fieldformatter
generate:plugin:fieldtype
generate:plugin:fieldwidget
generate:plugin:imageeffect
generate:plugin:rest:resource
generate:plugin:rulesaction
generate:plugin:type:annotation
generate:plugin:type:yaml
generate:service
generate:theme
Interact	with	your	Drupal
installation.
site:new
site:install
container:debug
router:debug
router:debug
site:mode
site
site
site:maintenance [ON/OFF]
site:status
con g
config
config:debug
config:edit
config:export
config:export:content:type
config:export:single
config:export:view
config:import
config:import:single
config:override
user
user
user:login:clear:attempts
user:login:url
user:password:hash
user:password:reset
Learn	Drupal	8.
Use	--learning	option
$ drupal generate:controller
--module="example"
--class-name="ExampleController"
--method-name="hello"
--route="/hello/{name}"
--learning
--no-interaction
Faster and Smarter Development with Drupal Console
Write	an	integration
generate:command
$ drupal generate:command
--module="example"
--class-name="HelloCommand"
--command="example:hello"
--no-interaction
Faster and Smarter Development with Drupal Console
webpro ler
	
https://www.drupal.org/project/webpro ler
webpro ler:benchmark
webpro ler
webprofiler:benchmark
webprofiler:export
webprofiler:list
Automate	command	execution
chain
$ drupal chain
--file=~/path/to/start-project.yml
Faster and Smarter Development with Drupal Console
Remote	command	execution
site:debug
$ drupal site:debug
$ drupal site:debug sample.dev
# Sites configuration files at:
# ~/.console/sites/
--target
$ drupal --target=sample.dev c:r all
Faster and Smarter Development with Drupal Console
Tips
#Protip	1
Use	--root	option
$ drupal --root=/var/www/drupal8.dev
#Protip	2
Use	multilanguage	feature
# ~/.console/config.yml
application:
environment: 'prod'
language: en #available: en,es,fr,hu,pt,ro
editor: vim
temp: /tmp
Faster and Smarter Development with Drupal Console
Faster and Smarter Development with Drupal Console
#Protip	3
Use	default	values
# ~/.console/config.yml
application:
...
default:
commands:
generate:
controller:
options:
module: my_current_project
#Protip	4
Disable	contributed	commands
# ~/.console/config.yml
application:
...
disable:
modules:
- broken_module_name_one
- broken_module_name_two
#Protip	5
Use	command	alias
$ drupal cache:rebuild all
$ drupal c:r all
#Protip	6
Use	--help	option
$ drupal generate:module --help
Faster and Smarter Development with Drupal Console
#Protip	7
Use	--generate-inline
$ drupal generate:entity:config --generate-inline
Faster and Smarter Development with Drupal Console
#Protip	8
Use	--generate-chain
$ drupal generate:module --generate-chain
Faster and Smarter Development with Drupal Console
#Protip	9
Use	--generate-doc
$ drupal webprofiler:benchmark --generate-doc
Faster and Smarter Development with Drupal Console
#Protip	10
Use	peco	command
$ drupal router:debug
| peco | awk -F ' ' '{print $1}' |
xargs drupal router:debug
https://github.com/peco/peco
Faster and Smarter Development with Drupal Console
How	to	contribute?
Getting	the	project
Fork	your	own	copy	of	the	Console	repository
Clone	your	forked	repository.
$ git clone git@github.com:[github-user]/DrupalConsole.git
Download	dependencies	using	componser.
$ cd /path/to/DrupalConsole
$ composer install
http://bit.ly/console-fork
Before	commiting	your	code
Project	code	is	PSR-2	Coding	Style.
Generated	code	is	Drupal	Coding	Style.
http://www.php-fig.org/psr/psr-2/
https://www.drupal.org/coding-standards
Code	analysis
http://bit.ly/console-insight
http://bit.ly/console-travis
PHPQA	all-in-one	Analyzer	CLI	tool
PHP	Parallel	Lint
PHP_CodeSniffer
PHPLOC
PHP	Mess	Detector
PHPUnit
https://github.com/jmolivas/phpqa
Running	PHPQA	manually
$ cd /path/to/DrupalConsole
$ phpqa analyze --files=src/
Running	PHPQA	automatically
$ vim .git/hooks/pre-commit
# Paste this:
phpqa analyze --git
jmolivas dmouse enzolutions omero danielnv18 vacho esod cordoval Sutharsan chipkaye hugronaphor
kgaut webflo czettnersandor fluxsauce greg-1-anderson lucasmingarro Crell martinfrances107 bojanz danielrose28
MiguelC301 azarzag Jaesin rpayanm iadyax alexweber mimioc revagomes Chi-teck egulias heilop
LowellMontgomery mmenavas sethfischer emacoti jeqq benjy carlosroh edutrul albertvolkman jjcarrion dasjo
joshuataylor kendallsv kostajh lussoluca stevector ysramirez brantwynn langelhc
Contributors
Spread	the	word	and	love.
@drupalconsole	|	#drupalconsole
/~drupalconsole
Roadmap
Increase	code	coverage.
Multi-site	support.
Improve	documentation	and	translations.
Improve	verbose	code-output.
Dummy	content	generation.
Milestones
https://github.com/hechoendrupal/DrupalConsole/milestones
Upcomming	implementations
Meta	tag
Rules
[Your	module	here]
Let's	work	together	to	make	
awesome	tools	even	better.
Drush	integration
https://github.com/drush-ops/drush/pull/1337
One	more	thing...
GUI	for	the	CLI.
http://drupalgenerator.com/
Questions	&	Feedback
Feel	free	to	stalk	me	or	ask	any	question	at:
@jmolivas	|	@drupalconsole

More Related Content

PDF
[Srijan Wednesday Webinars] Faster and Smarter Development with Drupal Console
PDF
How to prototype interactive iPad applications in 30 minutes or less using Ap...
KEY
Brief Intro to Drupal
PDF
Drupal console
PDF
Drupal Console Deep Dive: How to Develop Faster and Smarter on Drupal 8
PDF
Drupal Console Deep Dive: How to Develop Faster and Smarter on Drupal 8
PPTX
Console presentation
PPTX
Console presentation
[Srijan Wednesday Webinars] Faster and Smarter Development with Drupal Console
How to prototype interactive iPad applications in 30 minutes or less using Ap...
Brief Intro to Drupal
Drupal console
Drupal Console Deep Dive: How to Develop Faster and Smarter on Drupal 8
Drupal Console Deep Dive: How to Develop Faster and Smarter on Drupal 8
Console presentation
Console presentation

Similar to Faster and Smarter Development with Drupal Console (20)

PPTX
Drupal 8 cli
PDF
[Srijan Wednesday Webinar] Mastering Drupal 8 Development with Drupal Console
PDF
Improving your Drupal 8 development workflow DrupalCampLA
PDF
Drupal 8 and Pantheon
PDF
How to Use the Command Line to Increase Speed of Development
PPTX
Exploring composer in drupal 8 with drupal project - salva molina
ODP
Drush A beginners guide to a advanced tool.
PPTX
Drupal DevOps - Melbourne DevOps July 2013
KEY
Intro to Drush
PDF
Using Grunt with Drupal
PDF
Modernize Your Drupal Development
PDF
Introduction to Drupal - Installation, Anatomy, Terminologies
PPTX
Ready. Set. Drupal! An Intro to Drupal 8, Part 2
ODP
Drush Presentation
PDF
Drupal Continuous Integration (European Drupal Days 2015)
PDF
Сontinuous Integration - step to continuous deployment
PPTX
An Introduction to Drupal & How to Use It by Sanket Jain
PDF
Drupal 8 DevOps . Profile and SQL flows.
PPTX
Resources for Navigating Drupal Upgrades: Versions 6 Through 8 And What It Me...
PDF
Symfony and Drupal 8
Drupal 8 cli
[Srijan Wednesday Webinar] Mastering Drupal 8 Development with Drupal Console
Improving your Drupal 8 development workflow DrupalCampLA
Drupal 8 and Pantheon
How to Use the Command Line to Increase Speed of Development
Exploring composer in drupal 8 with drupal project - salva molina
Drush A beginners guide to a advanced tool.
Drupal DevOps - Melbourne DevOps July 2013
Intro to Drush
Using Grunt with Drupal
Modernize Your Drupal Development
Introduction to Drupal - Installation, Anatomy, Terminologies
Ready. Set. Drupal! An Intro to Drupal 8, Part 2
Drush Presentation
Drupal Continuous Integration (European Drupal Days 2015)
Сontinuous Integration - step to continuous deployment
An Introduction to Drupal & How to Use It by Sanket Jain
Drupal 8 DevOps . Profile and SQL flows.
Resources for Navigating Drupal Upgrades: Versions 6 Through 8 And What It Me...
Symfony and Drupal 8
Ad

Recently uploaded (20)

PDF
MIND Revenue Release Quarter 2 2025 Press Release
PPTX
Big Data Technologies - Introduction.pptx
PDF
A comparative analysis of optical character recognition models for extracting...
PDF
Network Security Unit 5.pdf for BCA BBA.
PDF
Optimiser vos workloads AI/ML sur Amazon EC2 et AWS Graviton
PPTX
Cloud computing and distributed systems.
PDF
Mobile App Security Testing_ A Comprehensive Guide.pdf
PDF
NewMind AI Weekly Chronicles - August'25-Week II
PDF
cuic standard and advanced reporting.pdf
PDF
Blue Purple Modern Animated Computer Science Presentation.pdf.pdf
PDF
Chapter 3 Spatial Domain Image Processing.pdf
PDF
The Rise and Fall of 3GPP – Time for a Sabbatical?
PDF
Review of recent advances in non-invasive hemoglobin estimation
PDF
Peak of Data & AI Encore- AI for Metadata and Smarter Workflows
DOCX
The AUB Centre for AI in Media Proposal.docx
PPTX
Spectroscopy.pptx food analysis technology
PDF
Architecting across the Boundaries of two Complex Domains - Healthcare & Tech...
PDF
Profit Center Accounting in SAP S/4HANA, S4F28 Col11
PPTX
Machine Learning_overview_presentation.pptx
PDF
Build a system with the filesystem maintained by OSTree @ COSCUP 2025
MIND Revenue Release Quarter 2 2025 Press Release
Big Data Technologies - Introduction.pptx
A comparative analysis of optical character recognition models for extracting...
Network Security Unit 5.pdf for BCA BBA.
Optimiser vos workloads AI/ML sur Amazon EC2 et AWS Graviton
Cloud computing and distributed systems.
Mobile App Security Testing_ A Comprehensive Guide.pdf
NewMind AI Weekly Chronicles - August'25-Week II
cuic standard and advanced reporting.pdf
Blue Purple Modern Animated Computer Science Presentation.pdf.pdf
Chapter 3 Spatial Domain Image Processing.pdf
The Rise and Fall of 3GPP – Time for a Sabbatical?
Review of recent advances in non-invasive hemoglobin estimation
Peak of Data & AI Encore- AI for Metadata and Smarter Workflows
The AUB Centre for AI in Media Proposal.docx
Spectroscopy.pptx food analysis technology
Architecting across the Boundaries of two Complex Domains - Healthcare & Tech...
Profit Center Accounting in SAP S/4HANA, S4F28 Col11
Machine Learning_overview_presentation.pptx
Build a system with the filesystem maintained by OSTree @ COSCUP 2025
Ad

Faster and Smarter Development with Drupal Console