Skip to content

YouCan themes CLI

YouCan CLI is a command-line interface tool for building YouCan themes with a set of helpful features that help you speed up your development experience.

In the following guide, we will show you how to install the CLI and create your first YouCan theme.

Features

  • Initialize a YouCan theme project
  • Live reload
  • Pull your existing themes
  • Publish your theme

Installation

Requirements

YouCan CLI is built and run on the Node.js JavaScript runtime. to use it, you must have npm and Node installed, as well as git. Follow the instructions below to install the requirements on your development machine.

After successfully installed the prerequisites, use the command line to install the latest version of YouCan CLI Node.js package globally

bash
npm install -g @youcan/cli@latest

To make sure the installation was successful, run the following command to verify the installation, You should see a list of the available commands.

bash
youcan --help

Your first theme

You're only a few steps away from creating your first theme. To begin, run the following command to authorize the CLI to access your YouCan Store, A new page will open for authorization, click the Authorize button to grant access.

bash
youcan auth login

Now that you're ready to start your first project, run the following command to pull the default starter theme from the YouCan git repository.

bash
youcan theme init

After entering theme meta data such as name and author, the theme will be automatically pulled and extracted in your current working directory.

The last step is to cd into your theme folder and run dev command to start your local development server

bash
cd dt_theme_id
youcan theme dev

You’ll now be able to go preview your theme, Any changes you make to your code will trigger a reload and show you the most up-to-date version of your theme.


Congrats! 🎉 You’re now ready to make your first YouCan theme, For a detailed list of the commands that YouCan CLI supports, refer to Commands.