New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details →
Socket
Book a DemoSign in
Socket

@adobe/helix-cli

Package Overview
Dependencies
Maintainers
21
Versions
1212
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@adobe/helix-cli

Project Helix CLI

Source
npmnpm
Version
14.25.0
Version published
Weekly downloads
495
181.25%
Maintainers
21
Weekly downloads
 
Created
Source

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"]
  --tls-key, --tlsKey      Path to .key file (for enabling TLS)        [string]
  --tls-cert, --tlsCert    Path to .pem file (for enabling TLS)        [string]
  --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'.

setting up a self-signed cert for using https

  • create the certificate
$ openssl req -new -newkey rsa:4096 -x509 -sha256 -days 365 -nodes -out server.crt -keyout server.key -subj "/CN=localhost"

this will create 2 files: server.crt and server.key

  • start hlx with tls support
$ hlx up --tls-cert server.crt --tls-key server.key
    ____              __    ___   v14.21.4
   / __/______ ____  / /__ / (_)__
  / _// __/ _ `/ _ \/  '_// / / _ \
 /_/ /_/  \_,_/_//_/_/\_\/_/_/_//_/

info: Starting Franklin dev server v14.21.4
info: Local Franklin dev server up and running: https://localhost:3000/
  • (optional) Add arguments to .env file:
$ echo -e "HLX_TLS_CERT=server.crt\nHLX_TLS_KEY=server.key" >> .env

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

HTTP Proxy

In order to use a HTTP proxy (eg behind a corporate firewall), you can set the respective environment variables:

NO_PROXY is a list of host names (optionally with a port). If the input URL matches any of the entries in NO_PROXY, then the input URL should be fetched by a direct request (i.e. without a proxy).

Matching follows the following rules:

NO_PROXY=* disables all proxies. Space and commas may be used to separate the entries in the NO_PROXY list. If NO_PROXY does not contain any entries, then proxies are never disabled. If a port is added after the host name, then the ports must match. If the URL does not have an explicit port name, the protocol's default port is used. Generally, the proxy is only disabled if the host name is an exact match for an entry in the NO_PROXY list. The only exceptions are entries that start with a dot or with a wildcard; then the proxy is disabled if the host name ends with the entry. See test.js for examples of what should match and what does not.

*_PROXY The environment variable used for the proxy depends on the protocol of the URL. For example, https://example.com uses the "https" protocol, and therefore the proxy to be used is HTTPS_PROXY (NOT HTTP_PROXY, which is only used for http:-URLs).

If present, ALL_PROXY is used as fallback if there is no other match.

Global

optionvariabledefaultdescription
--log-fileHLX_LOG_FILE-Log file. use - to log to stdout
--log-levelHLX_LOG_LEVELinfoLog level

Up command

optionvariabledefaultdescription
--portHLX_PORT3000Development server port
--addrHLX_ADDR127.0.0.1Development server bind address
--livereloadHLX_LIVERELOADtrueEnable automatic reloading of modified sources in browser.
--no-livereloadHLX_NO_LIVERELOADfalseDisable live-reload.
--openHLX_OPEN/Open a browser window at specified path after server start.
--no-openHLX_NO_OPENfalseDisable automatic opening of browser window.
--tls-keyHLX_TLS_KEYundefinedPath to .key file (for enabling TLS)
--tls-certHLX_TLS_CERTundefinedPath to .pem file (for enabling TLS)

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.

FAQs

Package last updated on 06 Sep 2023

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts