SlideShare a Scribd company logo
Drupal	Console	Deep	Dive
	
@drupalconsole	|	#drupalconsole
Jesus	Manuel	Olivas
Drupal	8	Solutions	Engineer
	|	
	
I	work	for	FFW
(and	you	should	too)
About	me
@jmolivas @drupalconsole
@drupodcast
Topics
Drupal	Console	the	what,	why	and	how.
Generate	code/files	required	by	a	Drupal	8	module.
Interact	and	Debug	Drupal	8.
Learn	Drupal	8.
Write	an	integration.
Automate	command	execution.
Remote	command	execution.
Contribute	to	the	project	and	Roadmap.
What	is	the	Drupal	Console?
The	new	CLI	for	Drupal.
The	Drupal	Console	is	a	tool	to	generate
boilerplate	code,	interact	and	debug	Drupal	8.
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?
Generate	boilerplate	code	for	Drupal	8.
Interact	and	debug	Drupal	8.
Learn	Drupal	8.
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
# Run this in your terminal to get the latest project version:
curl https://drupalconsole.com/installer -L -o drupal.phar
# Accessing from anywhere on your system:
mv drupal.phar /usr/local/bin/drupal
# Apply executable permissions on the downloaded file:
chmod +x /usr/local/bin/drupal
# Copy configuration files to user home directory:
drupal init --override
# Check and validate system requirements
drupal check
Using	Composer
$ composer global require drupal/console:@stable
# download path:
# ~/.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	/	Container
DrupalVM
Drupal	8	Sprint	Box
Drupal	development	with	Docker
Drude	(Drupal	Docker	Environment)
http://www.drupalvm.com/
https://github.com/thom8/drupal8-vagrant
https://github.com/wadmiraal/docker-drupal
https://github.com/blinkreaction/drude
Updating	the	project
$ drupal self-update
$ php console.phar self-update
$ composer global update drupal/console
Copy	con guration	 les
drupal	init
Validate	system	requirements
drupal	check
site:new
site:install
chain
chain
chain	--file=~/.console/chain/quick-start.yml
~/.console/chain/quick-start.yml
	
drupal	chain	--file=~/.console/chain/quick-start-mysql.yml
Execute	Drupal	Console
# change directory to site path
$ cd /var/www/drupal8.dev
$ drupal
# use --root option
$ drupal --root=/var/www/drupal8.dev
Generate	the	code	and	 les
required	by	a	Drupal	8	module.
Creating	a	module
Create	a	new	directory	named	'example'	at
'modules/custom'	directory.
Create	an	'example.info.yml'	file	at
'modules/custom/example'	directory.
Custom	and	contributed	modules	must	be	created
at	modules	folder	in	the	root	directory.
generate:module
Drupal Console Deep Dive: How to Develop Faster and Smarter on Drupal 8
Creating	a	Custom	Page
Create	a	'HelloController'	Class	with	a	'hello'
method	at	'src/Controller'	Directory.
Create	a	route	with	path	to	'/hello/{name}'	at
'example.routing.yml'	file.
Make	sure	your	HelloController	class	extends	from
ControllerBase	core	class.
generate:controller
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
Drupal Console Deep Dive: How to Develop Faster and Smarter on Drupal 8
Creating	a	Con g	Form
Create	a	'ExampleForm.php'	class	at	'src/Form'
Directory.
Create	a	route	with	path	to
'/admin/config/example/example'	at
'example.routing.yml'.
Add	example.links.menu.yml	file	and	set
system.admin_config_system	as	parent.
Make	sure	you	use	_form	instead	of	_controller	on
route	defaults.
generate:form:con g
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
example.routing.yml
src/Form/ExampleForm.php
src/Form/ExampleForm.php
src/Form/ExampleForm.php
Creating	a	Block	(Plugin)
Create	a	'ExampleBlock'	class	at	'src/Plugin/Block'.
Extend	from	BlockBase	core	class.
Add	@Block	annotation.
Add	blockForm,	blockSubmit	and	build	methods.
Adding	the	@Block	annotation,	make	this	block
discoverable	by	the	system.
generate:plugin:block
$ drupal generate:plugin:block
--module="example"
--class="ExampleBlock"
--label="example_block"
--plugin-id="example_block"
--no-interaction
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
generate:entity:content
$ drupal generate:entity:content
--module="example"
--entity-class="Foo"
--entity-name="foo"
--no-interaction
Drupal Console Deep Dive: How to Develop Faster and Smarter on Drupal 8
Interact	and	debug	Drupal	8.
drupal	container:debug
container:debug
drupal	container:debug	|	peco
drupal	router:debug
drupal	router:debug	|	peco	|	awk	'{print	$1}'	|	xargs	drupal	router:debug
drupal	router:debug	user.login
drupal	site:mode	dev	[1/2]
Performance
/admin/config/development/performance
Views	settings
/admin/structure/views/view/content
Logging	and	errors
/admin/config/development/logging
drupal	site:mode	dev	[2/2]
Twig	debug
drupal	database:log:debug	--reverse	
--limit=20
drupal	database:log:debug	828
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="ExampleController"
--routes="title:hello method:hello path:/hello/{name}"
--test
--no-interaction
--learning
Drupal Console Deep Dive: How to Develop Faster and Smarter on Drupal 8
Write	an	integration
generate:command
$ drupal generate:command
--module="example"
--class-name="HelloCommand"
--command="example:hello"
--no-interaction
Drupal Console Deep Dive: How to Develop Faster and Smarter on Drupal 8
Remote	command	execution
Global	con guration
~/.console/config.yml
application:
...
remote:
user: root
port: 22
console: /usr/local/bin/drupal
keys:
public: ~/.ssh/id_rsa.pub
private: ~/.ssh/id_rsa
passphrase: ~/.ssh/passphrase.txt
Site	con guration
~/.console/sites/sample.yml
local:
root: /var/www/drupal8.dev
host: local
dev:
root: /var/www/html/drupal
host: 140.211.10.62
user: drupal
prod:
root: /var/www/html/docroot
host: live.drupal.org
user: drupal
console: /var/www/html/docroot/console.phar
site:debug
site:debug	sample.dev
--target	||	@
$ drupal --target=sample.dev cr all
$ drupal @sample.dev cr all
Remote	site	execution
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
Contributors
https://drupalconsole.com/contributors
Spread	the	word	and	love.
@drupalconsole	|	#drupalconsole
Roadmap
Increase	code	coverage.
Improve	documentation	and	translations.
Improve	verbose	code-output.	(--learning)
Improve	automate	capabilities.	(chain)
Milestones
https://github.com/hechoendrupal/DrupalConsole/milestones
Current	and	upcomming	implementations
Webpro ler	(devel	submodule)
Meta	tag
Drupal	Commerce
Scheduled	Updates
Rules
Casper	(theme)
Liberty	(theme)
What	if	...	I	am	not	a	CLI	guru
GUI	for	the	CLI.
Desktop/Native	application	using
Electron
ReactJS
ES6
Questions	&	Feedback
Feel	free	to	stalk	me	or	ask	any	question	at:
@jmolivas	|	@drupalconsole

More Related Content

PPTX
Acquia Content Hub: Connect Technologies & Extend Systems to Source Content
PDF
Introducing Acquia Content Hub: Take Control of Your Content Chaos
PDF
"Big Data beyond Apache Hadoop - How to Integrate ALL your Data" - JavaOne 2013
PDF
Connect Faster with SnapLogic at Workday Rising
PDF
Big Data beyond Apache Hadoop - How to integrate ALL your Data
PDF
Deploy to azure in less then 15 minutes
PDF
Digital Asset Management: A Platform Approach
PDF
"Hadoop and Data Warehouse (DWH) – Friends, Enemies or Profiteers? What about...
Acquia Content Hub: Connect Technologies & Extend Systems to Source Content
Introducing Acquia Content Hub: Take Control of Your Content Chaos
"Big Data beyond Apache Hadoop - How to Integrate ALL your Data" - JavaOne 2013
Connect Faster with SnapLogic at Workday Rising
Big Data beyond Apache Hadoop - How to integrate ALL your Data
Deploy to azure in less then 15 minutes
Digital Asset Management: A Platform Approach
"Hadoop and Data Warehouse (DWH) – Friends, Enemies or Profiteers? What about...

What's hot (20)

PDF
Azure and OSS, a match made in heaven
PDF
Nuxeo Fact Sheet
PDF
Building GSD&M’s Digital Asset Management Solution
PDF
Webinar: Hybrid Cloud Integration - Why It's Different and Why It Matters
PDF
5 Reasons not to use Dita from a CCMS Perspective
PDF
Enterprise Integration Patterns Revisited (EIP) for the Era of Big Data, Inte...
PPTX
The SnapLogic Integration Cloud for ServiceNow
PDF
HP Helion - Copaco Cloud Event 2015 (break-out 4)
PDF
O365Con18 - Power BI Governance - Folker Visser
PDF
No sql now2011_review_of_adhoc_architectures
PPTX
Scenarios for building Hybrid Cloud
PDF
On Demand BI
PDF
The Power of the Hybrid Cloud
PPTX
01 mad cap_software
PPTX
What’s New in OpenText Media Management 16.3?
PPTX
Journey to the Cloud: What I Wish I Knew Before I Started
PDF
Why Migrate from MySQL to Cassandra
PDF
Autodesk Knowledge Network: A Knowledge Ecosystem Approach to Integrated Cont...
PDF
cross cloud inter-operability with iPaaS and serverless for Telco cloud SDN/NFV
PDF
Webinar: iPaaS in the Enterprise - What to Look for in a Cloud Integration Pl...
Azure and OSS, a match made in heaven
Nuxeo Fact Sheet
Building GSD&M’s Digital Asset Management Solution
Webinar: Hybrid Cloud Integration - Why It's Different and Why It Matters
5 Reasons not to use Dita from a CCMS Perspective
Enterprise Integration Patterns Revisited (EIP) for the Era of Big Data, Inte...
The SnapLogic Integration Cloud for ServiceNow
HP Helion - Copaco Cloud Event 2015 (break-out 4)
O365Con18 - Power BI Governance - Folker Visser
No sql now2011_review_of_adhoc_architectures
Scenarios for building Hybrid Cloud
On Demand BI
The Power of the Hybrid Cloud
01 mad cap_software
What’s New in OpenText Media Management 16.3?
Journey to the Cloud: What I Wish I Knew Before I Started
Why Migrate from MySQL to Cassandra
Autodesk Knowledge Network: A Knowledge Ecosystem Approach to Integrated Cont...
cross cloud inter-operability with iPaaS and serverless for Telco cloud SDN/NFV
Webinar: iPaaS in the Enterprise - What to Look for in a Cloud Integration Pl...
Ad

Similar to Drupal Console Deep Dive: How to Develop Faster and Smarter on Drupal 8 (20)

PDF
Faster and Smarter Development with Drupal Console
 
PDF
[Srijan Wednesday Webinars] Faster and Smarter Development with Drupal Console
PDF
From Drupal 7 to Drupal 8 - Drupal Intensive Course Overview
PPT
Drupal A non technical Introduction
PDF
Drupal for beginners - Global Training Days - Cebu 2016
PPTX
Intro to drupal
PDF
Why and When to use Drupal by Luc Bezier - Drupalcamp Cebu 2018
ODP
Drupal introduction
PPTX
Hacking core
PPT
Contributing to Drupal
PPT
DrupalCampHI - Drupal vs WordPress
PDF
[HKDUG] #20151017 - BarCamp 2015 - Drupal 8 is Coming! Are You Ready?
PDF
Choosing Drupal as your Content Management Framework
PDF
Drupal Café October 2014: DrupalCon Amsterdam
ODP
20120314 voipdrupal-hands-on-webinar
PDF
Drupal 8 and Pantheon
PDF
Contributing to Drupal 8
PPTX
Drupal in 5
PDF
Introduction to drupal
Faster and Smarter Development with Drupal Console
 
[Srijan Wednesday Webinars] Faster and Smarter Development with Drupal Console
From Drupal 7 to Drupal 8 - Drupal Intensive Course Overview
Drupal A non technical Introduction
Drupal for beginners - Global Training Days - Cebu 2016
Intro to drupal
Why and When to use Drupal by Luc Bezier - Drupalcamp Cebu 2018
Drupal introduction
Hacking core
Contributing to Drupal
DrupalCampHI - Drupal vs WordPress
[HKDUG] #20151017 - BarCamp 2015 - Drupal 8 is Coming! Are You Ready?
Choosing Drupal as your Content Management Framework
Drupal Café October 2014: DrupalCon Amsterdam
20120314 voipdrupal-hands-on-webinar
Drupal 8 and Pantheon
Contributing to Drupal 8
Drupal in 5
Introduction to drupal
Ad

More from Acquia (20)

PDF
Acquia_Adcetera Webinar_Marketing Automation.pdf
PDF
Acquia Webinar Deck - 9_13 .pdf
PDF
Taking Your Multi-Site Management at Scale to the Next Level
PDF
CDP for Retail Webinar with Appnovation - Q2 2022.pdf
PDF
May Partner Bootcamp 2022
PDF
April Partner Bootcamp 2022
PDF
How to Unify Brand Experience: A Hootsuite Story
PDF
Using Personas to Guide DAM Results: How Life Time Pumped Up Their UX and CX
PDF
Improve Code Quality and Time to Market: 100% Cloud-Based Development Workflow
PDF
September Partner Bootcamp
PDF
August partner bootcamp
PDF
July 2021 Partner Bootcamp
PDF
May Partner Bootcamp
PDF
DRUPAL 7 END OF LIFE IS NEAR - MIGRATE TO DRUPAL 9 FAST AND EASY
PDF
Work While You Sleep: The CMO’s Guide to a 24/7/365 Lead Machine
PDF
Acquia webinar: Leveraging Drupal to Bury Your Sales Team In B2B Leads
PDF
April partner bootcamp deck cookieless future
PDF
How to enhance cx through personalised, automated solutions
PDF
DRUPAL MIGRATIONS AND DRUPAL 9 INNOVATION: HOW PAC-12 DELIVERED DIGITALLY FOR...
PDF
Customer Experience (CX): 3 Key Factors Shaping CX Redesign in 2021
Acquia_Adcetera Webinar_Marketing Automation.pdf
Acquia Webinar Deck - 9_13 .pdf
Taking Your Multi-Site Management at Scale to the Next Level
CDP for Retail Webinar with Appnovation - Q2 2022.pdf
May Partner Bootcamp 2022
April Partner Bootcamp 2022
How to Unify Brand Experience: A Hootsuite Story
Using Personas to Guide DAM Results: How Life Time Pumped Up Their UX and CX
Improve Code Quality and Time to Market: 100% Cloud-Based Development Workflow
September Partner Bootcamp
August partner bootcamp
July 2021 Partner Bootcamp
May Partner Bootcamp
DRUPAL 7 END OF LIFE IS NEAR - MIGRATE TO DRUPAL 9 FAST AND EASY
Work While You Sleep: The CMO’s Guide to a 24/7/365 Lead Machine
Acquia webinar: Leveraging Drupal to Bury Your Sales Team In B2B Leads
April partner bootcamp deck cookieless future
How to enhance cx through personalised, automated solutions
DRUPAL MIGRATIONS AND DRUPAL 9 INNOVATION: HOW PAC-12 DELIVERED DIGITALLY FOR...
Customer Experience (CX): 3 Key Factors Shaping CX Redesign in 2021

Recently uploaded (20)

PDF
Electronic commerce courselecture one. Pdf
PPT
“AI and Expert System Decision Support & Business Intelligence Systems”
PDF
Network Security Unit 5.pdf for BCA BBA.
PDF
cuic standard and advanced reporting.pdf
PPTX
sap open course for s4hana steps from ECC to s4
PPT
Teaching material agriculture food technology
PDF
TokAI - TikTok AI Agent : The First AI Application That Analyzes 10,000+ Vira...
PDF
Diabetes mellitus diagnosis method based random forest with bat algorithm
PDF
Peak of Data & AI Encore- AI for Metadata and Smarter Workflows
PPTX
Programs and apps: productivity, graphics, security and other tools
PDF
Empathic Computing: Creating Shared Understanding
PPTX
Big Data Technologies - Introduction.pptx
PDF
Encapsulation_ Review paper, used for researhc scholars
PDF
Unlocking AI with Model Context Protocol (MCP)
PDF
A comparative analysis of optical character recognition models for extracting...
PDF
Assigned Numbers - 2025 - Bluetooth® Document
PDF
NewMind AI Weekly Chronicles - August'25-Week II
PDF
Per capita expenditure prediction using model stacking based on satellite ima...
PDF
Agricultural_Statistics_at_a_Glance_2022_0.pdf
PDF
Chapter 3 Spatial Domain Image Processing.pdf
Electronic commerce courselecture one. Pdf
“AI and Expert System Decision Support & Business Intelligence Systems”
Network Security Unit 5.pdf for BCA BBA.
cuic standard and advanced reporting.pdf
sap open course for s4hana steps from ECC to s4
Teaching material agriculture food technology
TokAI - TikTok AI Agent : The First AI Application That Analyzes 10,000+ Vira...
Diabetes mellitus diagnosis method based random forest with bat algorithm
Peak of Data & AI Encore- AI for Metadata and Smarter Workflows
Programs and apps: productivity, graphics, security and other tools
Empathic Computing: Creating Shared Understanding
Big Data Technologies - Introduction.pptx
Encapsulation_ Review paper, used for researhc scholars
Unlocking AI with Model Context Protocol (MCP)
A comparative analysis of optical character recognition models for extracting...
Assigned Numbers - 2025 - Bluetooth® Document
NewMind AI Weekly Chronicles - August'25-Week II
Per capita expenditure prediction using model stacking based on satellite ima...
Agricultural_Statistics_at_a_Glance_2022_0.pdf
Chapter 3 Spatial Domain Image Processing.pdf

Drupal Console Deep Dive: How to Develop Faster and Smarter on Drupal 8