magento cli
文档: https://experienceleague.adobe.com/en/docs/commerce-operations/reference/magento-open-source
magento cli 的用途
- Installation (and related tasks such as creating or updating the database schema, creating the deployment configuration).
安装 (以及创建或更新数据库架构、创建部署配置等相关任务)。 - Clearing the cache.
清除缓存。 - Managing indexes, including reindexing.
管理索引,包括重新编制索引。 - Creating translation dictionaries and translation packages.
创建翻译词典和翻译包。 - Generating non-existent classes such as factories and interceptors for plug-ins, generating the dependency injection configuration for the object manager.
为插件生成不存在的类,如工厂和拦截器,为对象管理器生成依赖项注入配置。 - Deploying static view files.
部署静态视图文件。 - Creating CSS from Less.
从 Less 创建 css。
通用命令
- 查看所有命令:
bin/magento list
- 查看特定命令的帮助信息:
bin/magento help <command>
通用参数
Long version | Short version | Meaning |
---|---|---|
--help | -h | Get 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 | -q | Quiet mode; no output. 安静模式;无输出。 |
--no-interaction | -n | No interactive questions. 没有互动提问。 |
--verbose=1,2,3 | -v, -vv, -vvv | Verbosity 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 | -V | Display this application version 显示此应用程序版本 |
--ansi | n/a | Force ANSI output 强制 ANSI 输出 |
--no-ansi | n/a | Disable ANSI output 禁用 ANSI 输出 |
安装 magento 需要用到的命令
Command | Description | Prerequisites |
---|---|---|
magento setup:install | Installs the application 安装应用程序 | None |
magento setup:uninstall | Removes the application. 卸载应用程序 | Application installed 应用程序安装 |
magento setup:upgrade | Updates 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:set | Creates or updates the deployment configuration. 创建或更新部署配置 | None |
magento module:{enable/disable} | Enable or disable modules. 启用或禁用模块 | None |
magento setup:store-config:set | Sets storefront-related options, such as base URL, language, timezone. 设置与店面相关的选项,如基本 URL、语言、时区 | Deployment configuration 部署配置 |
magento setup:db-schema:upgrade | Updates the database schema. 更新数据库架构 | Deployment configuration 部署配置 |
magento setup:db-data:upgrade | Updates the database data. 更新数据库数据 | Deployment configuration 部署配置 |
magento setup:db:status | Checks if the database is up to date with the code. 检查数据库的代码是否是最新的。 | Deployment configuration 部署配置 |
magento admin:user:create | Creates 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 list | Lists all available commands. 列出所有可用命令。 | None |
magento help | Provides help for the specified command. 为指定命令提供帮助。 | None |