How to set up a local shopify theme development environment
In the seventh article, As requested, I’ll be talking about how to set up a local shopify theme development environment.
Let’s go!
To create unlimited Shopify stores for development, you can create a Shopify Partner account using this link
Install ThemeKit
ThemeKit is the Offical Shopify tool to work with Shopify themes locally
macOS Installation
brew tap shopify/shopifybrew install themekit
Windows Chocolatey Installation
choco install themekit
Linux Installation
curl -s [<https://shopify.github.io/themekit/scripts/install.py>](<https://shopify.github.io/themekit/scripts/install.py>) | sudo python
Create Private Shopify App
- Go Admin > Apps and click on manage private apps at the bottom of the page
- Click on Enable Private App Development and enable it
- Create a new private app and select Themes with reading and write permissions
- Copy the Password
Configure ThemeKit
- Go Online Store > Themes and click on edit code for the Shopify theme you want to work with locally
- In the URL bar, you’ll have the Shopify theme ID like this one https://ilias-demo.myshopify.com/admin/themes/ID
Create a directory for this theme
Run this command to download your theme code
theme get -p=your-password -s=[you-store.myshopify.com](<http://you-store.myshopify.com/>) -t=your-theme-id
and run this command to watch for file changes and upload them automatically to your remote Shopify theme
theme watch
It’s recommended to have config file, to prevent from overwriting the config/settings_data.json file that has the Shopify theme data like Shopify sections content or have a different environment
development: password: Password theme_id: theme_id store: example.myshopify.com ignore_files: - config/settings_data.jsonproduction: password: Password theme_id: theme_id store: example.myshopify.comtest: password: Password theme_id: theme_id store: example.myshopify.com
References: