Shopify CLI¶
In this article
Information
Shopify CLI is a command-line tool that helps you build Shopify apps and themes. It quickly generates apps, themes, and custom Shopify storefronts. You can also use it to automate many common development tasks.
Shopify CLI: Key Features¶
- Fast Project Creation: Quickly initialize new Shopify app and theme projects using a pre-configured structure and dependencies.
- Local Testing: Supports local running and testing of apps and themes without deploying them.
- 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 basic 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.
- Bug Fixing: Provides tools for debugging apps and themes.
- Extension Support: Supports working with various types of Shopify extensions, including extensions for additional functionality and verification.
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:
-
Open a terminal and connect to the server using the command:
-
Upon first connection, confirm the server's authenticity by entering "yes" to add the key to the list of known hosts.
-
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
. -
To create a new theme, use the command:
-
To navigate to the directory containing the created theme, use the command:
-
To launch the theme in development mode, use the command:
If you aren't logged in, the system will automatically prompt you to log in when executing this command: -
To authenticate, click on any button, then copy the provided URL, open it in your browser, and complete the authentication process:
-
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.