Overview
SHOPLINE CLI is a command-line interface tool designed to assist you in efficiently building and generating SHOPLINE themes.
This article provides an overview of how to use SHOPLINE CLI for theme development.
Features
SHOPLINE CLI offers several functionalities and advantages that facilitate efficient theme development:- Safe preview and testing: You can securely preview, test, and share changes to your theme using a development theme.
- Real-time updates: The content of the preview link is refreshed in real-time when theme files are changed.
- Theme initialization: Start a new theme based on the Bottle theme.
- Command-line theme deployment: Push themes directly from the command line.
Development theme
A development theme is a temporary hidden theme connected to a SHOPLINE store used for development. When you connect the theme as a development theme to your store, you can use store data for local testing.- Creation: Use the
sl theme servecommand to create a development theme. - Usage: You can use development themes in the SHOPLINE store. They do not count against your theme limit and will be deleted after 7 days of inactivity.
- Deletion: Use the
sl logoutcommand to delete your development theme. If you want to access the theme preview link after logging out, you must push your development theme to your store as an unpublished theme.
Your development theme can be used for the following tasks:
- Observe real-time changes in your locally developed theme.
- Use the theme editor in the SHOPLINE Admin to interact with your theme.
- Share the theme link with other developers.
Getting started
Refer to the SHOPLINE CLI getting started guide to:- Understand the prerequisites for using SHOPLINE CLI.
- Learn how to connect to a store.
- Create a new theme.
- Preview your theme.
Theme directory structure
Certain theme commands, such assl theme serve, will only function when your directory matches the SHOPLINE standard theme directory structure. This structure indicates that the theme requires no further build steps or necessary file conversions. If you use build tools to generate theme files, you may need to run theme-related commands in the directory storing the generated files.
The standard SHOPLINE theme directory structure is as follows:
└── project
├── blocks
├── components
├── layout
├── public
├── sections
├── i18n
├── templates
├── theme.config.json
└── theme.schema.json
Command reference
SHOPLINE CLI provides essential commands for authentication and communication with SHOPLINE, as well as specific commands for theme development:Upgrade or uninstall SHOPLINE CLI
To learn how to upgrade or uninstall SHOPLINE CLI, refer to the guide on Upgrade and uninstallation.Was this article helpful to you?