magento cli

文档: https://experienceleague.adobe.com/en/docs/commerce-operations/reference/magento-open-source

magento cli 的用途

通用命令

通用参数

Long versionShort versionMeaning
--help-hGet help for any command. For example, ./magento help setup:install or ./magento help setup:config:set.
寻求任何命令的帮助。例如,或者。 ./magento help setup:install ./magento help setup:config:set
--quiet-qQuiet mode; no output.
安静模式;无输出。
--no-interaction-nNo interactive questions.
没有互动提问。
--verbose=1,2,3-v, -vv, -vvvVerbosity level. For example, --verbose=3 or -vvv displays debug verbosity, which is the most verbose output. Default is --verbose=1 or -v.
详细程度。例如,或显示调试详细度,这是最详细的输出。 --verbose=3 -vvv 默认值为或。 --verbose=1 -v
--version-VDisplay this application version
显示此应用程序版本
--ansin/aForce ANSI output
强制 ANSI 输出
--no-ansin/aDisable ANSI output
禁用 ANSI 输出

安装 magento 需要用到的命令

CommandDescriptionPrerequisites
magento setup:installInstalls the application
安装应用程序
None
magento setup:uninstallRemoves the application.
卸载应用程序
Application installed
应用程序安装
magento setup:upgradeUpdates the application.
更新应用程序
Deployment configuration
部署配置
magento maintenance:{enable/disable}Enables or disables maintenance mode (in maintenance mode, only exempt IP addresses can access the Admin or storefront).
启用或禁用维护模式(在维护模式下,只有豁免 IP 地址才能访问 Admin 或店面)
Application installed
应用程序安装
magento setup:config:setCreates or updates the deployment configuration.
创建或更新部署配置
None
magento module:{enable/disable}Enable or disable modules.
启用或禁用模块
None
magento setup:store-config:setSets storefront-related options, such as base URL, language, timezone.
设置与店面相关的选项,如基本 URL、语言、时区
Deployment configuration
部署配置
magento setup:db-schema:upgradeUpdates the database schema.
更新数据库架构
Deployment configuration
部署配置
magento setup:db-data:upgradeUpdates the database data.
更新数据库数据
Deployment configuration
部署配置
magento setup:db:statusChecks if the database is up to date with the code.
检查数据库的代码是否是最新的。
Deployment configuration
部署配置
magento admin:user:createCreates an administrator user.
创建管理员用户
You can create users for the following:
您可以为以下内容创建用户:

Deployment configuration
部署配置

Enable at minimum the Magento_User and Magento_Authorization modules
至少启用和模块 Magento_User Magento_Authorization

Database (simplest way is to use bin/magento setup:upgrade)
数据库(最简单的方法是使用) bin/magento setup:upgrade
magento listLists all available commands.
列出所有可用命令。
None
magento helpProvides help for the specified command.
为指定命令提供帮助。
None