Live Editor CLI Reference

A listing of all commands and options for the Live Editor CLI theme development tool.

Live Editor CLI is a command line interface for building, previewing, and syncing your Live Editor theme. For instructions on installing Live Editor CLI, refer to the Development Environment guide. Live Editor CLI also expects a specific file and directory structure.

Following is a complete list of commands that can be run with Live Editor CLI and documentation for each.

Table of contents


General commands

help

Lists all commands available from the liveeditor utility.

Syntax

liveeditor help [COMMAND]

Parameters

Parameter Required Description
COMMAND No string Narrow the listings down to a particular command.

Examples

Help for top-level commands
liveeditor help

Output

      Commands:
      liveeditor generate SUBCOMMAND  # Generator for new layouts, content templates, navigation menus, etc.
      liveeditor help [COMMAND]       # Describes available commands or one specific command.
      liveeditor login                # Log in to the Live Editor service specified in `config.json`.
      liveeditor new TITLE            # Create a new skeleton theme
      liveeditor validate [TARGET]    # Validate config and assets
      liveeditor version              # Version of Live Editor CLI
Help for specific command
liveeditor help generate

Output

      Commands:
      liveeditor generate content_template TITLE [BLOCKS]  # Generate files needed for a new content template
      liveeditor generate help [COMMAND]                   # Describe subcommands or one specific command
      liveeditor generate layout TITLE                     # Generate files needed for a new layout
      liveeditor generate navigation TITLE                 # Generate files needed for a new navigation menu

version

Outputs the version of Live Editor CLI installed on your system.

Syntax

liveeditor version

Parameters

None.

Examples

liveeditor version

Example Output

Live Editor CLI v1.0.0

login

Authenticates against the Live Editor service and allows you to run other commands that require authentication.

You must have a proper admin_domain configured within config.json for this command to work.

Syntax

liveeditor login
Parameters

None.

Examples

liveeditor login

Output

      Logging in to Live Editor...
      Connecting to coffee.liveeditorapp.com.
      
      Email: chris@example.com
      Password (typing will be hidden):
      
      You are now logged in to the admin at `coffee.liveeditorapp.com`.

Theme commands

new

Generates a minimal file and folder structure needed to author a new Live Editor theme.

The new files and folders will be created within a subfolder based on the value that you pass in for the TITLE argument. For example, if you pass in a value of my_theme, the new theme will be generated within a my_theme subfolder.

Syntax

liveeditor new TITLE

Parameters

Parameter Required Description
TITLE Yes string Title of new theme. Can be in snake_case or in "Titleized Case". The skeleton theme will be generated in a new subfolder with the value of TITLE, lowercase and underscored. The TITLE will also be recorded in the generated README.md and theme.json files.

Examples

Generates a theme in a subfolder named my_theme
liveeditor new my_theme

Output

      Creating a new Live Editor theme titled "My Theme"...
      create  my_theme
      create  my_theme/.gitignore
      create  my_theme/README.md
      create  my_theme/assets/css/site.css
      create  my_theme/assets/fonts/.keep
      create  my_theme/assets/images/.keep
      create  my_theme/assets/js/init.js
      create  my_theme/assets/js/site.js
      create  my_theme/config.json.sample
      create  my_theme/content_templates/.keep
      create  my_theme/includes/.keep
      create  my_theme/layouts/layouts.json
      create  my_theme/layouts/site_layout.json
      create  my_theme/navigation/navigation.json
      create  my_theme/theme.json
Generates a theme in a subfolder named my_theme
liveeditor new "My Theme"

Output

      Creating a new Live Editor theme titled "My Theme"...
      create  my_theme
      create  my_theme/.gitignore
      create  my_theme/README.md
      create  my_theme/assets/css/site.css
      create  my_theme/assets/fonts/.keep
      create  my_theme/assets/images/.keep
      create  my_theme/assets/js/init.js
      create  my_theme/assets/js/site.js
      create  my_theme/config.json.sample
      create  my_theme/content_templates/.keep
      create  my_theme/includes/.keep
      create  my_theme/layouts/layouts.json
      create  my_theme/layouts/site_layout.json
      create  my_theme/navigation/navigation.json
      create  my_theme/theme.json

generate layout

Generates a .liquid template for a new layout and adds a minimal entry for it to layouts/layouts.json.

Syntax

liveeditor generate layout TITLE

Aliases

liveeditor g layout TITLE

Parameters

Parameter Required Description
TITLE Yes string Title of new layout. Can be in snake_case or in "Titleized Case". The Liquid template will be generated in the layouts subfolder, named after the TITLE, lowercase and underscored, with _layout appended to the end. For example, a layout titled Site will have a corresponding Liquid template named site_layout.liquid. The TITLE will also be added within a new entry in the layouts/layouts.json config file.

Examples

Generates a layout with a Liquid template named home_page_layout.liquid
liveeditor generate layout home_page

Output

      Creating a new Live Editor layout titled "Home Page"...
      append  layouts/layouts.json
      create  layouts/home_page_layout.liquid
Generates a layout with a Liquid template named home_page_layout.liquid
liveeditor generate layout "Home Page"

Output

      Creating a new Live Editor layout titled "Home Page"...
      append  layouts/layouts.json
      create  layouts/home_page_layout.liquid

generate content_template

Adds a minimal entry for a content template to content_templates/content_templates.json, a new folder structure for the new content template, and a .liquid default display.

Passing additional parameters in the format of var_name:type will create blocks for each. This is optional.

Syntax

liveeditor generate content_template TITLE [BLOCKS]

Aliases

liveeditor g content_template TITLE [BLOCKS]

Parameters

Parameter Required Description
TITLE Yes string Title of new content template. Can be in snake_case or in "Titleized Case". A new subfolder will be created within the content_templates folder, named after the TITLE, lowercase and underscored. For example, a content template titled Blog Post will have a corresponding subfolder named blog_post. Within that folder, a default_display.liquid template will be generated for a default display. The TITLE and new display will also be added within a new entry in the content_templates/content_templates.json config file.
BLOCKS No array var_name:type combinations for blocks to add to the generated content template within content_templates.json. Example: title:text image:photo summary:text. Leaving out the type will cause the block to default to a type of text.

Examples

Generates a content template titled Blog Post
liveeditor generate content_template blog_post

Output

      Creating a new content template titled "Blog Post"...
      append  content_templates/content_templates.json
      create  content_templates/blog_post/default_display.liquid
Generates a content template titled Blog Post
liveeditor generate content_template "Blog Post"

Output

      Creating a new content template titled "Blog Post"...
      append  content_templates/content_templates.json
      create  content_templates/blog_post/default_display.liquid
Generates a content template titled Article with 3 blocks: a text block titled Title, an image block titled Photo, and a text block titled Body
      liveeditor generate content_template article title:text photo:image body:text

Output

      Creating a new content template titled "Article"...
      append  content_templates/content_templates.json
      create  content_templates/article/default_display.liquid

validate

Validates folder structure and config files for proper content.

Syntax

liveeditor validate [TARGET]

Aliases

None.

Parameters

Parameter Required Description
TARGET No string Element of theme to validate. Leaving empty or passing a value of all will validate everything.

Valid values:
  • all
  • theme
  • config
  • layouts
  • content_templates
  • navigation
  • assets

Examples

Validate everything
liveeditor validate

Output

      Validating Live Editor theme...
      
      Validating config...
      OK
      
      Validating theme...
      OK
      
      Validating layouts...
      OK
      
      Validating content templates...
      OK
      
      Validating navigation menus...
      OK
      
      Validating assets...
      OK
Validate just layouts
liveeditor validate layouts

Output

      Validating Live Editor theme...
      
      Validating layouts...
      OK