Facebook iconHow To Use Shopify CLI for Themes (A Step-by-Step Guide)
Blogs/Shopify

How To Use Shopify CLI for Themes (A Step-by-Step Guide)

Jan 9, 20254 Min Read
Written by Sahil Singh
How To Use Shopify CLI for Themes (A Step-by-Step Guide) Hero

When working on Shopify stores, developers often face a common challenge: finding the corresponding CSS styles or JavaScript functions for elements with specific classes, IDs, and attributes. In a live Shopify environment, this means manually searching through multiple files to locate where these selectors are being used – be it stylesheets, theme files, or JavaScript modules.

This process is much simpler in local development environments like Visual Studio Code. There, you can simply copy a class name, ID, or attribute, use the global search feature (Ctrl+Shift+F or Cmd+Shift+F), and instantly see all occurrences across your project files. The search results clearly show which files contain these selectors and provide context, making it much easier to trace how an element is being styled or manipulated.

Not just this, working on the Shopify store has its fair share of shortfalls.

1. When multiple developers need to collaborate on a single theme, they must each create separate theme copies. This is necessary because simultaneous work on the same theme can lead to code conflicts, where one developer's changes might accidentally override another's modifications.

2. It’s hard to keep track of all the changes as there is no proper version control system

Without a proper version control system, tracking changes across theme files becomes challenging. This is where Shopify CLI comes in handy - it's a command line interface that allows you to work on themes locally, preview changes, and deploy updates through your terminal. By developing locally, you can integrate your theme files with GitHub, providing robust version control and eliminating issues with code conflicts and change tracking.

Here is a step-by-step guide for working on themes locally using a Shopify CLI,

1. Pre-requisites

Before the steps make sure to have the,

Node.js: 18.20+, 20.10 or higher
A Node.js package manager: npm, Yarn 1.x, or pnpm.
Git: 2.28.0 or higher

2. Install Shopify CLI Globally

Paste the following command to your terminal.

npm install -g @shopify/cli@latest
Installing Shopify CLI Globally

3. Pull the theme to which you want to work locally

After Installing the Shopify CLI, use the following command to pull the theme files to your local system.

 shopify theme pull --store store_name_here.myshopify.com
Shopify theme pull

You will then be redirected to the browser for login verification, Once confirmed with the login.

In your terminal, you'll see a list of all theme files currently in your store. From here, you'll need to select the specific theme you want to work on.

Once selected, the CLI will begin downloading the theme files to your local system.

Once the download completes, you can access all the theme files in your local directory.

4. Use the Shopify theme dev for previewing the changes while working on the theme locally

Use the following command while working on the theme locally to see the changes in preview

shopify theme dev
Use the Shopify theme dev for previewing the changes while working on the theme locally

Click [1] to open the theme preview or [2] to access the theme editor.

Let's try to make some changes in the theme file

In the index file, Lets change the heading for the banner image from “Equip Yourself with Our Latest Camping Gear”

Partner with Us for Success

Experience seamless collaboration and exceptional results.

Collection to something else,

As you edit the file, your changes will automatically reflect in the preview window.

And In the terminal also

6. Use Command Theme Push to push the changes from local to store

Once done with all the changes use the command below,

shopify theme push

Next, select the theme file to which you want your changes to be pushed to

On confirmation, the Shopify CLI will start uploading files to the store

Once Completed the Terminal would show the message of success,

The Changes would reflect on the live website or on the theme to which you have pushed your code.

And that's it!!!

Partner with Us for Success

Experience seamless collaboration and exceptional results.

Our Final Words

I hope this guide has shown you how Shopify CLI can streamline your theme development workflow. By working locally, you can leverage your favorite IDE features, collaborate effectively with team members through Git version control, and maintain better oversight of your code changes.

This approach not only enhances productivity but also makes theme development more organized and efficient.

Need expert help?

Looking to enhance your Shopify store but not sure where to start? F22 Labs specializes in custom Shopify development and optimization. Our team of certified Shopify experts can help transform your e-commerce vision into reality, offering tailored solutions from theme customization to full-scale store development. Contact us to elevate your online store.

Author-Sahil Singh
Sahil Singh

I’m a Front-End developer with 1.3 years of experience creating user-friendly, optimized web pages. I specialize in developing features that boost conversion rates for e-commerce websites.

Phone

Next for you

A Guide To Shopify Store Speed Optimisation in 2025 Cover

Shopify

Jun 4, 20255 min read

A Guide To Shopify Store Speed Optimisation in 2025

Google data shows 53% of mobile users abandon sites that take over 3 seconds to load, and a 1-second delay can slash conversions by 20%. For Shopify store owners, those numbers hit hard. But here’s the good news: you don’t need a big team or deep pockets to make your store blazing fast. With smart tools, a lean approach, and a clear plan, you can turn your Shopify store into a high-speed sales machine. Ready to make your store unstoppable? This Shopify store speed optimisation guide is your ul

12 Essential Questions to Ask Before Hiring a Shopify Developer Cover

Shopify

Jun 3, 20257 min read

12 Essential Questions to Ask Before Hiring a Shopify Developer

Pick the wrong Shopify developer, and you’re stuck with a glitchy site, missed deadlines, and a drained budget. Choose the right one, and your store becomes a fast, stunning sales machine.  Finding the perfect developer doesn’t have to feel like a gamble. You just need the right questions to separate the pros from the pretenders. In this article, you will learn the 12 essential questions before hiring Shopify developers and ensure your store is built to make money, so you can focus on growing y

How To Turn Shopify Store Traffic to Sales in 8 Steps in (2025) Cover

Shopify

Jun 3, 20256 min read

How To Turn Shopify Store Traffic to Sales in 8 Steps in (2025)

Clicks are rolling in, analytics dashboards are glowing, and you’re ready to watch sales stack up. But at the end of the day? Crickets. No orders, no revenue, just a sinking feeling that something’s broken.  Your traffic isn’t converting, and every missed sale feels like a punch. In 2025, traffic without sales isn’t just frustrating, it’s a sign your store’s letting customers slip through the cracks. Conversions are your store’s lifeblood.  If you’re getting 1,000 visitors a month, that’s the