Installing and Initialising the CLI

Overview

The Interplay CLI can help you create a UMD build of your components and generate config for Interplay by bundling and parsing your code automatically.

Only the compiled build and the generated config is sent to Interplay, not your source code.

Installing the CLI

It is usually easiest to install the Interplay CLI and its React plugin globally using npm:

npm install -g @interplay/cli @interplay/cli-plugin-react

Initialise your CLI settings

1. Check your Interplay account

In your browser, navigate to https://app.interplay.io/ and check you can login to your workspace before running the import.

2. Initialise your CLI Settings file

👉

Please run the CLI at the base of your repo so that the CLI is aware of all the packages in your repo. Enter all settings paths relative to the base of your repo

The first step in using the CLI is to initialise your config by registering a new project to contain your code. In the root folder of your repo:

interplay init

Running this command will popup a browser for you to specify the project to import to:

image

Set the project name you would like to use and click Continue.

Two config files will be created in the .interplay folder in your repo. These files control the import:

  • targets.json - this controls the target team and project you are importing to
  • interplay.config.js - this controls all the other settings required such as the packages to import, the files to bundle and the settings to use when parsing your presets.

In the sections that follow we'll update the relevant config and then run the relevant CLI command to build , parse and deploy your components.