# Marfeel CLI

Marfeel CLI

A command line interface for working with Marfeel Media Groups.

# Installation

Install Marfeel CLI globally with npm:

npm i -g @marfeel/cli

# Getting Started

Start the development server and compile your assets.

marfeel start

Then open http://localhost:7766/ to see your sites.

Make your code really shine and run your unit tests and execute the linter with the following commands.

marfeel test
marfeel lint

# Commands

# Build

Builds all the source files required to run a site.

Usage
  $ marfeel build [site] [options]

Options
  -b, --build-number  The build number used for this build.
  -d, --devices       A comma separated list of target devices. Valid options are, 's', 'l' and 'xl'.
  -p, --production    Performs the build in production mode, applying optimizations such as code-minification.
  -v, --variant       Build for a specific variant. Valid options are 'React'.
  -w, --watch         Start the build in watch mode.

You can use the :scripts or :styles modifiers to selectively build parts of your application.

# Create Fixtures

Downloads the HTML of a given URL and places it under the fixtures/ folder.

Usage
  $ marfeel create:fixtures [options] [url]

Options
  -m, --marfeel      Marfeel folder where the fixtures will be generated (by default is 'index')
  -t, --tenant       Tenant folder where the fixtures will be generated (by default is the first tenant of the MediaGroup)

As first option, this command tries to infer the tenant and marfeel from the url passed as parameter. If it does not find a <tenant>/<marfeel> existing path, it will try to resolve it with the flags (--tenant and --marfeel) or default values of those flags.

# End-to-End Testing

Launch the End-to-End testing suite to ensure your site is working as expected.

Usage

marfeel e2e [env] [device-type]

# Help

Displays information on how to use the different commands.

Usage

  marfeel help

# Lint

Usage

  marfeel lint [options]

Options

  -f, --fix
 -d, --diff    Performs lint check only on changed files. It compares current branch with master.
   --files   Performs lint check only on selected files, passed in a comma-separated string: --files=path/to/fileNameOne.js,path/to/fileNameTwo.json

You can use the :js, :json and :styles modifiers to selectively lint parts of your application.

If flags --diff and --files are passed at the same time, --files will take precedence.

# Middleware

Run your local middleware on the remote middleware runtime using a fixture or a real article/section uri.

Usage

  marfeel middleware [middlewareName] [articleUri | sectionUri | fixturePath]

Options

  -w, --watch Keeps the process running and looking for changes on the middlewares directory.

# Serve

Start the development server to access your sites.

Usage

  marfeel serve [site] [options]

Options

  -b, --bind-address
  -p, --port

# Start

Usage

  marfeel start [site]

# Test

Run unit tests associated to the source of a Media Group (or [tenant]).

Usage

  marfeel test [tenant]

You can use the :core or :widgets modifiers to selectively test parts of your application.