连接到商店
第一次输入要求您与 Shopify 商店交互的命令时,将标志--store
与命令一起传递并指定要与之交互的商店:
shopify theme dev --store my-store
my-store更换为你要登录的shopify地址
例如: shopify theme dev --store shopupup.myshopify.com
在指定新存储之前,您指定的存储将用于以后的命令。
如果您想更改您正在与之交互的商店,请使用--store
您的命令传递标志,指定您想要与之交互的新商店。
要检查您使用的是哪个商店,请运行shopify theme info
:
shopify theme info
输出
THEME CONFIGURATION
-----------------------
Store my-store.myshopify.com
...
在帐户之间切换
如果您需要在账户之间切换,则使用以下命令注销当前账户:
shopify auth logout
下次您输入需要身份验证的命令时,系统会提示您登录,并可以输入一组新的凭据。
常用命令列表
Command overview
Topic | Command | Description |
---|---|---|
theme | init | Clones a Git repository to your local machine to use as the starting point for building a theme. |
dev | Uploads the current theme to a store so you can preview it. | |
check | Calls and runs Theme Check to analyze your theme code for errors and to ensure that it follows theme and Liquid best practices. | |
list | Lists the themes in your store. | |
open | Returns links that let you preview the specified theme. | |
pull | Retrieves theme files from Shopify. | |
push | Uploads your local theme files to Shopify, overwriting the remote version if specified. | |
share | Uploads your theme as a new, unpublished theme in your theme library. | |
publish | Publishes an unpublished theme from your theme library. | |
package | Packages your local theme files into a ZIP file that can be uploaded to Shopify. | |
delete | Deletes a theme from your store. | |
language-server | Starts a Language Server Protocol server. | |
info | Displays information about your theme environment. | |
auth | logout | Logs you out of your Shopify account. |
config | autocorrect | Enables or disables command autocorrection. |
none | help | Lists the available commands and describes what they do. |
version | Displays the version of Shopify CLI that you’re running. | |
upgrade | Upgrades the @shopify/cli and @shopify/theme packages to their latest versions. |