Skip to content

Shopify CLI

In this article

Information

The Shopify CLI is a command-line tool designed to streamline the process of creating, developing, and managing Shopify apps and themes. It provides developers with a set of commands for quickly setting up projects, local testing, deployment, and interacting with the Shopify API. The Shopify CLI integrates with the Shopify ecosystem, enabling developers to effectively work on Shopify projects without manually configuring their environment.

Shopify CLI: Key Features

  • Rapid Project Creation: Allows you to initialize new Shopify app and theme projects with a pre-configured structure and dependencies.
  • Local Testing: Supports running and testing apps and themes locally without requiring deployment.
  • Theme Management: Provides commands for working with Shopify themes, including uploading, downloading, and synchronizing theme files.
  • API Integration: Simplifies interaction with various Shopify APIs, including the Admin API and Storefront API.
  • Code Generation: Includes commands for creating essential app components and extensions.
  • Authentication: Streamlines the authentication process with Shopify stores and partner accounts.
  • App Management: Enables you to create, update, and publish Shopify apps.
  • Debugging: Offers tools for debugging apps and themes.
  • Extension Support: Allows you to work with different types of Shopify extensions, including verification extensions and functions.
  • Process Automation: Supports automation of various development and deployment tasks.

Build Features

  • Installable on Ubuntu 22.04+, Rocky Linux 9 family.
  • Installation time: 15-20 minutes, including OS setup.
  • Pre-installed dependencies:
    • Node.js v20.16.0
    • Git 2.34.1
    • Shopify CLI 3.65.3
    • npm 10.8.1

Getting Started with Shopify CLI After Deployment

After purchasing an order, you'll receive a notification email at the address provided during registration. This notification will indicate your VPS's IP address and login credentials for connecting. Our company clients manage their server equipment through the server management panel and API - Invapi.

You can find authorization data either in the Info >> Tags section of the server management panel or in the sent email:

  • Login and Password for connecting to the server sent to your email address after the server is ready for use following software deployment..

Connecting to the Server and Logging into Shopify

Attention

To use Shopify CLI, you need an active Shopify account and access to the store you intend to work with.

Information

Starting from Shopify CLI version 3.0, there's no explicit command for authentication anymore. If you aren't logged in, the system will automatically prompt you to log in when executing a command requiring authorization. Shopify CLI uses OAuth 2.0 for authentication. This means that after running an authorization-requiring command, you'll be redirected to the Shopify login page in your browser. You'll then need to log into your account and confirm access to the desired store. OAuth 2.0 is a standard for secure authorization, allowing access to your store without needing to manually store passwords or tokens.

To connect to the server and log into Shopify, follow these steps:

  1. Open a terminal and connect to the server using the command:

    ssh root@<server_ip>
    
  2. Upon first connection, confirm the server's authenticity by entering "yes" to add the key to the list of known hosts.

  3. Once successfully authenticated, you can begin managing your store.

    Attention

    Whether you're working with apps, themes, or Hydrogen, all commands for interacting with Shopify should start with the prefix shopify.

    Note

    If you encounter an error about Bundler being required when attempting to launch a theme, install it:

    gem install bundler
    
  4. To create a new theme, use the command:

    shopify theme init my-new-theme
    
  5. To navigate to the directory containing the created theme, use the command:

    cd /root/my-new-theme
    
  6. To launch the theme in development mode, use the command:

    shopify theme dev --store=your-store.myshopify.com
    
    If you aren't logged in, the system will automatically prompt you to log in when executing this command:

  7. To authenticate, click on any button, then copy the provided URL, open it in your browser, and complete the authentication process:

  8. After successful authentication, a "Logged in" message will appear in the terminal, and the command requiring authorization will start executing. You'll also see links for viewing and editing the theme locally and within Shopify's admin panel:

Note

Detailed information about basic Shopify CLI settings can be found in the developer documentation.

Ordering a server with Shopify CLI using the API

To install this software using the API, follow these instructions.