What is Drupal Console ?
The Drupal CLI. A tool to generate boilerplate code, interact with and debug Drupal.
How to install Drupal Console ?
composer require drupal/console:~1.0 \
--prefer-dist \
--optimize-autoloader
Drupal Console commands List
$ drupal list
Drupal Console version 1.9.8
Usage:
command [options] [arguments]
Options:
Available commands:
about Displays basic information about Drupal Console project
chain Chain command execution
check System requirement checker
composerize Converts Drupal codebase to composer.
exec Execute an external command.
help Displays help for a command
init Copy configuration files.
list Lists all available commands
server (serve,rs) Runs PHP built-in web server
shell Open a shell providing an interactive REPL (Read–Eval–Print-Loop).
snippet Runs PHP code
cache
cache:rebuild (cr,cc) Rebuild and clear all site caches.
cache:tag:invalidate (cti) Invalidate cache tags.
config
config:delete (cd) Delete configuration
config:diff (cdi) Output configuration items that are different in active configuration compared with a directory.
config:edit (ced,cdit) Change a configuration object with a text editor.
config:export (ce) Export current application configuration.
config:export:content:type (cect) Export a specific content type and their fields.
config:export:entity (cee) Export a specific config entity and their fields.
config:export:single (ces) Export a single configuration or a list of configurations as yml file(s).
config:export:view (cev) Export a view in YAML format inside a provided module to reuse in another website.
config:import (ci) Import configuration to current application.
config:import:single (cis) Import a single configuration or a list of configurations.
config:override (co) Override config value in active configuration.
config:validate (cv) Validate a drupal config against its schema
config_pages
config_pages:get_value (cpgfv) Config pages get value command.
config_pages:set_value (cpsfv) Config pages set value command.
config_split
config_split:export (csex) Configuration Split Export
config_split:import (csim) Configuration Split Import
create
create:nodes (crn) Create dummy nodes for your Drupal 8 application.
create:roles (crr) Create dummy roles for your Drupal 8 application.
create:terms (crt) Create dummy terms for your Drupal 8 application.
create:users (cru) Create dummy users for your Drupal 8 application.
create:vocabularies (crv) Create dummy vocabularies for your Drupal 8 application.
cron
cron:execute (croe,cre) Execute cron implementations by module or execute all crons
cron:release (cror) Release cron system lock to run cron again
database
database:add (dba) Add a database to settings.php
database:client (dbc) Launch a DB client if it's available
database:connect (dbco,sqlc) Shows DB connection
database:drop (dbd) Drop all tables in a given database.
database:dump (dbdu) Dump structure and contents of a database
database:log:clear (dblc) Remove events from DBLog table, filters are available
database:log:poll (dblp) Poll the watchdog and print new log entries every x seconds
database:query (dbq,sqlq) Executes a SQL statement directly as argument
database:restore (dbr) Restore structure and contents of a database.
debug
debug:breakpoints (dbre) Displays breakpoints available in application
debug:cache:context (dcc) Displays current cache context for the application.
debug:chain (dch) List available chain files.
debug:config (dc) List configuration objects names and single configuration object.
debug:config:settings (dcs) Displays current key:value on settings file.
debug:config:validate (dcv) Validate a schema implementation before a module is installed.
debug:container (dco,cod) Displays current services for an application.
debug:cron (dcr) List of modules implementing a cron
debug:database:log (dbb,ws) Displays current log events for the application
debug:database:table (ddt) Show all tables in a given database.
debug:dotenv Debug Dotenv debug values.
debug:entity (de) Debug entities available in the system
debug:event (dev) Displays current events
debug:hook (dbh) commands.debug.hook.description
debug:image:styles (dis) List image styles on the site
debug:libraries (dl) Displays libraries available in application
debug:module (dm) Displays current modules available for application
debug:multisite (dmu,msd) List all multi-sites available in system
debug:permission (dp) Displays all user permissions.
debug:plugin (dpl) Displays all plugin types.
debug:queue (dq) Displays the queues of your application
debug:rest (rede) Display current rest resource for the application
debug:roles (dusr) Displays current roles for the application
debug:router (dr,rod) Displays current routes for the application or information for a particular route
debug:settings (dse) List user Drupal Console settings.
debug:site (dsi) List all known local and remote sites.
debug:state (dst) Show the current State keys.
debug:theme (dt,tde) Displays current themes for the application
debug:theme:keys (dtk) Displays all theme keys provided by hook_theme functions
debug:update (du,upd) Displays current updates available for the application
debug:update:composer (duc) Displays current updates available from the composer file
debug:user (dus) Displays current users for the application
debug:views (vde) Displays current views resources for the application
debug:views:plugins (dvp) Displays current views plugins for the application
devel
devel:dumper (dd) commands.devel.dumper.messages.change-devel-dumper-plugin
develop
develop:contribute Download Drupal + Drupal Console to contribute.
docker
docker:init Create a docker-compose.yml file
dotenv
dotenv:init Add support and required config to work with an .env file
entity
entity:delete (ed) Delete a specific entity
field
field:info (fii) View information about fields.
generate
generate:ajax:command (gac) Generate & Register a custom ajax command
generate:authentication:provider (gap) Generate an Authentication Provider
generate:block:type (gbt) Generate a block content type
generate:breakpoint (gb) Generate breakpoint
generate:cache:context (gcc) Generate a cache context
generate:command (gco) Generate commands for the console.
generate:composer (gcom) Generate a composer.json file
generate:controller (gcon) Generate & Register a controller
generate:entity:bundle (geb) Generate a new content type (node / entity bundle)
generate:entity:config (gec) Generate a new config entity
generate:entity:content (geco) Generate a new content entity
generate:event:subscriber (ges) Generate an event subscriber
generate:form (gf) Generate a new "FormBase"
generate:form:alter (gfa) Generate an implementation of hook_form_alter() or hook_form_FORM_ID_alter
generate:form:config (gfc) Generate a new "ConfigFormBase"
generate:help (gh) Generate an implementation of hook_help()
generate:jstest (gjt) Generate a JavaScript test.
generate:module (gm) Generate a module.
generate:module:file (gmf) Generate a .module file
generate:permissions (gp) Generate module permissions
generate:plugin:block (gpb) Generate a plugin block
generate:plugin:ckeditorbutton (gpc) Generate CKEditor button plugin.
generate:plugin:condition (gpco) Generate a plugin condition.
generate:plugin:derivative (gpd) commands.generate.derivative.description
generate:plugin:field (gpf) Generate field type, widget and formatter plugins.
generate:plugin:fieldformatter (gpff) Generate field formatter plugin.
generate:plugin:fieldtype (gpft) Generate field type plugin.
generate:plugin:fieldwidget (gpfw) Generate field widget plugin.
generate:plugin:imageeffect (gpie) Generate image effect plugin.
generate:plugin:imageformatter (gpif) Generate image formatter plugin.
generate:plugin:mail (gpm) Generate a plugin mail
generate:plugin:migrate:dataparser (gpmdp) Generate a migrate data parser
generate:plugin:migrate:process (gpmp) Generate a migrate process plugin
generate:plugin:migrate:source (gpms) Generate a migrate source plugin
generate:plugin:queue (gpqueue) Drupal Console Queueworker generator.
generate:plugin:rest:resource (gprr) Generate plugin rest resource
generate:plugin:rules:action (gpra) Generate a plugin rule action
generate:plugin:rules:dataprocessor (gprd) Generate a plugin rule dataprocessor
generate:plugin:skeleton (gps) Generate an implementation of a skeleton plugin
generate:plugin:type:annotation (gpta) Generate a plugin type with annotation discovery
generate:plugin:type:yaml (gpty) Generate a plugin type with Yaml discovery
generate:plugin:validationconstraint (gpvc) Generate a validation constraint plugin.
generate:plugin:views:field (gpvf) Generate a custom plugin view field.
generate:post:update (gpu) Generate an implementation of hook_post_update_NAME()
generate:profile (gpr) Generate a profile.
generate:routesubscriber (gr) Generate a RouteSubscriber
generate:service (gs) Generate service
generate:site:alias (gsa) Generates a site alias.
generate:theme (gt) Generate a theme.
generate:theme:setting (gts) Generate a setting configuration theme
generate:twig:extension (gte) Generate a Twig extension.
generate:update (gu) Generate an implementation of hook_update_N()
image
image:styles:flush (isf) Execute flush function by image style or execute all flush images styles
locale
locale:language:add Add languages to be supported by your site
locale:language:delete Delete a language to be supported by your site
locale:translation:status List available translation updates
module
module:dependency:install (modi) Install dependencies module in the application
module:download (mod) Download module or modules in application
module:install (moi) Install module or modules in the application
module:path (mop) Returns the relative path to the module (or absolute path)
module:uninstall (mou) Uninstall module or modules in the application
module:update (moup) Update core, module or modules in the application
multisite
multisite:new (mun,sn) Sets up the files for a new multisite install.
multisite:update (muu) Update the files for a multisite installed.
node
node:access:rebuild (nar) Rebuild node access permissions.
queue
queue:run (qr) Process the selected queue.
quick
quick:start Download, install and serve a new Drupal project
rest
rest:disable (red) Disable a rest resource for the application
rest:enable (ree) Enable a rest resource for the application
role
role:delete (rd) Delete roles for the application
role:new (rn) Create roles for the application
router
router:rebuild (rr,ror) Rebuild routes for the application
service
service:override (so) Override services value.
settings
settings:set Change a specific setting value in DrupalConsole config file
site
site:import:local (sil) Import/Configure an existing local Drupal project
site:install (si) Install a Drupal project
site:maintenance (sma) Switch site into maintenance mode
site:mode (smo) Switch system performance configuration
site:new Download a new Drupal project
site:statistics (sst) Show the current statistics of website.
site:status (ss,st) View current Drupal Installation status
state
state:delete (std) Delete State
state:override (sto) Override a State key.
taxonomy
taxonomy:term:delete (ttd) Delete taxonomy terms from a vocabulary
theme
theme:download (thd) Download theme in application
theme:install (thi) Install theme or themes in the application
theme:path (thp) Returns the relative path to the theme (or absolute path)
theme:uninstall (thu) Uninstall theme or themes in the application
update
update:entities (upe) Applying Entity Updates
update:execute (upex,updb) Execute a specific Update N function in a module, or execute all
user
user:create (uc) Create users for the application
user:delete (ud) Delete users from the application
user:login:clear:attempts (ulca,uslca) Clear failed login attempts for an account.
user:login:url (ulu,usli,uli) Returns a one-time user login url.
user:password:hash (uph,usph) Generate a hash from a plaintext password.
user:password:reset (upr,upsr) Reset password for a specific user.
user:role (ur) Adds/removes a role for a given user
user:unblock (uu) Unblock a specific user.
views
views:disable (vd,vdi) Disable a View
views:enable (ve) Enable a View