Reprint: HTTPS://YPLAM.COM/POST/79
Drupal Console is a set of command-line tools for Drupal 8 that generates Drupal 8 template code and can interact with Drupal 8 apps.
The Drupal Console is a bit similar to the familiar Drush, but offers a different function that can be used in conjunction with Drush.
Installation
$ curl -LSs http://drupalconsole.com/installer | php
windows下:
php -r "readfile(‘http://drupalconsole.com/installer‘);" | php
Of course, you can also move it to the system's path path and rename it to the Drupal command
$ mv console.phar /usr/local/bin/drupal
Go to a Drupal installation directory and run
list
It lists the commands and profiles that are currently available. If you have used Symfony before, you will feel very familiar with it.
Drupal Console Version0.9.3Usage:command [Options] [arguments]options:-H,--help Display this help message-q,--quiet do not output any message-v,--version Display This application version--ansi Force ANSI Output--no-ansi Disable ANSI Output-N--no-interaction do don't ask any interactive question--root[=root] Application.console.arguments.root-s,--shell Launch the shell. -E--ENV[=ENV] the environment name. [Default: "Prod"]--no-debug switches off debug mode.--learning Generate a verbose code output. -T--target[=target] APPLICATION.CONSOLE.ARGUMENTS.TARGET-V|VV|VVV,--verbose increase the verbosity of messages:1 for normal output, 2 for more verbose output and 3 for DEBUG-GC,--generate-chain Print execution Options and arguments as YAML output to is used in chain Command-gi,--generate-inline Print execution options and arguments as inline call to is use in the FUTURE-GD,--generate-doc application.console.arguments.generate-docavailable Commands: _completion BASH completion hook. About the Display basic information about Drupal ConsoleProjectChainChain command executionComplete commands.Complete.description Drush Run DrushFrom console.Help DisplaysHelpFor a command init Copy configuration filesToUser HomeDirectory.List Lists Commandsself-UpdateUpdate the consoleTo latestVersion.CacheCacheRebuildRebuildandClear all site caches. Config Config:debugShow theCurrent configuration. Config:edit Edit the selected configuration. ConfigExportExportCurrent application configuration. ConfigExportContentTypeExport a specificContentTypeand theirFields. ConfigExport:singleExport Single ConfigurationAs YmlFile. ConfigExportViewExport AViewIn YAMLFormat inside a providedModuleToReuseIn the other website. ConfigImportImport ConfigurationToCurrent application. ConfigImport:singleImport the selected configuration. Config:override Override ConfigValueIn active configuration.ContainerContainer:debug DisplaysCurrent ServicesFor the application. Cron Cron:debugListof modules implementing a cron cron:ExecuteExecute Cron implementationsByModuleOrExecute all crons cron:ReleaseRelease CronSystemLockTo run cron again DBLog DBLog:Clear RemoveEventsFrom DBLogTable, Filtersis available Dblog:debug DisplayCurrentLogEventsFor the application generate generate:Authentication:provider Generate anAuthentication Provider Generate:command Generate commandsFor the console. Generate:controller Generate &Register a controller Generate:doc commands.generate.doc.description Generate:entity:bundle generate aNewContentType (node/entity bundle) Generate:entity:config commands.generate.entity.description generate:entity:Content Commands.generate.entity.description Generate:Event:subscriber Generate anEvent Subscriber Generate:FormAlter Generate an implementationof Hook_form_alter ()or Hook_form_form_id_alter Generate:Form:config Generate ANew"Configformbase" Generate:Module Generate AModule. Generate:permissions GenerateModule permissions Generate:PluginBlock Generate APluginBlock Generate:Plugin:condition Generate APlugin condition. GeneratePluginField GenerateFieldType, widgetand formatter plugins. GeneratePlugin:fieldformatter GenerateField FormatterPlugin. GeneratePlugin:fieldtype GenerateFieldTypePlugin. GeneratePlugin:fieldwidget GenerateField WidgetPlugin. GeneratePlugin:imageeffect Generate Image EffectPlugin. GeneratePlugin:imageformatter Generate Image FormatterPlugin. GeneratePlugin:rest:Resource GeneratePlugin restResource Generate:Plugin:rulesaction Generate APlugin ruleAction Generate:PluginType:annotation Generate APluginTypeWith annotation discovery Generate:PluginType:yaml Generate APluginTypeWith Yaml discovery Generate:Plugin:views:Field Generate a customPluginViewField. Generate:service Generate service Generate:theme generate a theme. Migrate Migrate:debug DisplayCurrentMigration availableFor the application migrate:ExecuteExecute AMigration availableFor application migrate:Load Generate AMigration entity.ModuleModule:debug DisplayCurrent modules availablefor applicationModule:downloadInstallModuleor modulesIn the applicationModuleInstallInstallModuleor modulesIn the applicationModuleUninstallInstallModuleor modulesIn the application rest rest:debug DisplayCurrent restResourceFor the application rest:DisableDisable a RestResourceFor the application rest:EnableEnable a RestResourceFor the application router Router:debug displaysCurrent routesFor the application router:RebuildRebuild routesFor the application site Site:debugList all knownLocaland remote sites. SiteInstallInstall a DrupalProject Site:maintenanceSwitch siteinto maintenanceMode site:ModeSwitchSystemPerformance Configuration site:NewCreate ANew DrupalProject site:StatusViewCurrent Drupal InstallationStatusTestTest:debugListTest Units AvailableFor the application.Test:run RunTest UnitFrom Tests availablefor applicationUpdateUpdate:debug DisplayCurrent Updates AvailableFor the applicationUpdateExecute DisplayCurrent Updates AvailableFor the applicationUserUser:login:Clear:attemptsClear LoginFailed attemptsFor aAccount.User:login:UrlReturns a OneTimeUser LoginUrl.UserPasswordHash Generate AHashFrom a plaintextPassword.UserPasswordResetResetPasswordFor a specificUser. Views Views:debug DisplayCurrent views ResourcesFor the application views:DisableDisable AView Views:EnableEnable AView Yaml yaml:diff Compare both Yaml filesDo determined differencesBetween them YAML:MergeMerge Oneor more YAML filesIn aNew YAMLfile. Latest values are preserved. Yaml: split split a YAML file using indent as separator criteria Yaml: Update:key replace a YAML key Span class= "Hljs-keyword" >in a YAML file. Yaml:update:value update a value for a specific key in a YAML file.
Among them, the personal think that the more commonly used should be generate:: The following a bunch of orders, especially because Drupal 8 under the addition of entity, etc. need to do is more work, these commands can greatly reduce duplication of labor.
Drupal 8 Console Command-line tool