← 返回命令列表

Linux command

drupal 命令

文本

复制后可按需替换文件名、目录或参数。

常用示例

List all available commands

drupal list

Generate module scaffolding

drupal generate:module

Generate a controller class

drupal generate:controller

Clear and rebuild all caches

drupal cache:rebuild

Install and enable a module

drupal module:install [module_name]

Run pending database updates

drupal update:execute

Check site status and configuration

drupal site:status

说明

Drupal Console is a CLI tool for generating boilerplate code, interacting with, and debugging Drupal 8+ applications. Built on the Symfony Console component, it accelerates development through code generation and provides utilities for common administrative tasks. The generate commands create scaffolding for modules, plugins, controllers, forms, and other Drupal components following best practices. Interactive prompts guide through configuration options. Drupal Console also provides debugging tools, cache management, configuration import/export, and database operations from the command line.

参数

generate:module
Generate module scaffolding.
generate:controller
Generate controller class.
cache:rebuild
Clear all caches.
module:install _NAME_
Install and enable module.
site:status
Show site information.
update:execute
Run database updates.
--help
Display help information.

FAQ

What is the drupal command used for?

Drupal Console is a CLI tool for generating boilerplate code, interacting with, and debugging Drupal 8+ applications. Built on the Symfony Console component, it accelerates development through code generation and provides utilities for common administrative tasks. The generate commands create scaffolding for modules, plugins, controllers, forms, and other Drupal components following best practices. Interactive prompts guide through configuration options. Drupal Console also provides debugging tools, cache management, configuration import/export, and database operations from the command line.

How do I run a basic drupal example?

Run `drupal list` in a terminal, then adjust file names, paths, flags, or remote targets for your system.

What does generate:module do in drupal?

Generate module scaffolding.