Theme CLI Guide
The Theme CLI is a command-line tool for managing your storefront themes. It allows you to login, list, pull, push, and logout from your store directly through the terminal.
This guide explains the available commands, their usage, and marks planned commands as "Coming Soon."
1. CLI Installation & Setup
- Open your terminal or command prompt.
- Authenticate with your store using the
login
command. - After login, you can manage your themes using the available commands.
2. Available Commands
-
Login
Purpose: Authenticate your CLI session with the store.
Usage:theme-cli login
Steps:
- Enter your store credentials (email and password or API token).
- Once login is successful, your CLI session is active.
-
Theme list
Purpose: Display all available themes for the authenticated store.
Usage:theme list
Example Output:
ID Name Status 1 Default Theme Active 2 Custom Theme Inactive Notes:
- Shows both active and inactive themes.
- Use the ID of a theme for pull or push operations.
-
Theme pull
Purpose: Download a theme from the store to your local environment.
Usage:theme pull
Steps:
- Provide the theme ID to pull.
- All theme files will be downloaded into your local theme folder.
- You can now edit sections, templates, assets, and configurations locally.
-
Theme push
Purpose: Upload local theme changes to the store.
Usage:theme push
Steps:
- Ensure your local theme folder follows the correct 8-folder structure:
- assets, config, layout, locales, sections, blocks, snippets, templates.
- Provide the theme ID to push updates.
All changes from local will be uploaded to the store.
- Ensure your local theme folder follows the correct 8-folder structure:
-
Logout
Purpose: End your CLI session.
Usage:logout
3. Best Practices
- Always login before using any commands.
- Use theme list to confirm theme IDs before pull/push.
- Maintain a backup of your local theme before pushing changes.
- Ensure the 8-folder structure is intact to avoid sync errors.
- Test changes in a safe environment before pushing to the live store.