The Shopify CLI is the tool developers use to build apps and storefronts for the Shopify platform. This wiki contains documentation that’s useful for contributors of the project.
If you’d like to contribute to this project, the following system dependencies need to be present in the environment.
Once you have the necessary system dependencies, you can go through the steps below to have your environment setup to work with the project:
git clone https://github.com/Shopify/cli.git
.pnpm install
You can run the CLIs through the following package.json
scripts:
pnpm shopify
: Builds and runs the Shopify CLI.pnpm create-app
: Builds and runs the create-app CLI.All commands support the --path
argument, so you can run any command pointing to your app. For example, pnpm shopify app build --path /path/to/project
If you want to quickly test creating an app from scratch, you can run bin/create-test-app.js
. It will:
You can also pass these optional flags:
-e <extensions>
to choose which extensions you want (ui
, theme
, or function
)--deploy
to deploy your app to Shopify--cleanup
to remove the app directory afterwardsIf you want to interact with it, you can cd
into the directory and run the CLI through the scripts in the package.json
:
Command | PNPM |
---|---|
shopify | pnpm shopify |
build | pnpm build |
dev | pnpm dev |
test | pnpm test |
generate | pnpm generate |
If you want to quickly test creating a theme from scratch, you can run bin/create-test-theme.js -s YOUR_STORE
. It will:
You can also pass these optional flags:
--cleanup
to remove the theme directory afterwardsBesides the scripts for building and running the CLIs, there are others that might come handy when adding code to the project:
pnpm test
: Runs the tests of all the packages.pnpm lint
: Runs ESLint and Prettier checks for all the packages.pnpm lint:fix
: Runs ESLint and Prettier checks for all the packages and fixes the fixable issues.pnpm type-check
: Type-checks all the packagesusing the Typescript tsc
tool.pnpm clean
: Removes the dist
directory from all the packages.All the packages in the repository contain the above scripts so they can be executed too for an individual package.