@adobe/helix-cli

Project Helix CLI

Usage no npm install needed!

<script type="module">
  import adobeHelixCli from 'https://cdn.skypack.dev/@adobe/helix-cli';
</script>

README

Helix Command Line Interface (hlx)

Status

codecov CircleCI GitHub license GitHub issues LGTM Code Quality Grade: JavaScript

The Helix Command Line Interface allows web developers to create, develop, and deploy digital experiences using Project Helix

Installation

Install hlx as a global command. You need Node 12.11 or newer.

$ npm install -g @adobe/helix-cli

Quick Start

$ hlx --help
Usage: hlx <command> [options]

Commands:
  hlx up  Run a Helix development server

Options:
  --version                Show version number                         [boolean]
  --log-file, --logFile    Log file (use "-" for stdout)  [array] [default: "-"]
  --log-level, --logLevel  Log level
        [string] [choices: "silly", "debug", "verbose", "info", "warn", "error"]
                                                               [default: "info"]
  --help                   Show help                                   [boolean]

use <command> --help to get command specific details.

for more information, find our manual at https://github.com/adobe/helix-cli

Starting development

$ cd <my-cool-project>
$ hlx up

automatically open the browser

The --open argument takes a path, eg --open=/products/, will cause the browser to be openend at the specific location. Disable with --no-open'.

environment

All the command arguments can also be specified via environment variables. the .env file is loaded automatically.

example:

.env

HLX_OPEN=/products
HLX_PORT=8080
HLX_PAGES_URL=https://stage.myproject.com

Global

option variable default description
--log-file HLX_LOG_FILE - Log file. use - to log to stdout
--log-level HLX_LOG_LEVEL info Log level

Up command

option variable default description
--port HLX_PORT 3000 Development server port
--livereload HLX_LIVERELOAD true Enable automatic reloading of modified sources in browser.
--no-livereload HLX_NO_LIVERELOAD false Disable live-reload.
--open HLX_OPEN / Open a browser window at specified path after server start.
--no-open HLX_NO_OPEN false Disable automatic opening of browser window.

Developing Helix CLI

Testing

You can use npm run check to run the tests and check whether your code adheres to the helix-cli coding style.