Finsemble: Using The CLI

Using the CLI

The command line interface (CLI) is a collection of node scripts that make quick work of creating the skeleton for new components and FSBL clients. This overview explains how to set up the CLI and describes the function of each command.

Setup

After downloading Finsemble, run:

npm install and npm install -g @chartiq/finsemble-cli.

Once the CLI is installed you can run:

> finsemble-cli

Run the command without any argument to see example commands.


CLI actions

Add a component

> finsemble-cli add component <yourComponentName>

This command does two things for you:

  1. It creates a new component with the recommended directory structure.

     src/components/
         └──yourComponentName/
             └──yourComponentName.html
             └──yourComponentName.css
             └──yourComponentName.js
    
  2. It adds your component to configs/componentList.json with default options implemented.

Add a React component

> finsemble-cli add component <yourComponentName> --react-component=true

Similar to the first command, this script creates the appropriate directory structure and adds your component to configs/componentList.json. It also adds your React component to the Webpack build process so that Webpack watches and rebuilds the files when they change.

Webpack gets the list of components it should watch and build from configs/componentsToBuild.json.

    src/components/
        └──yourComponentName/
            └──src/
                └──components/
                └──stores/
                └──app.jsx
                └──yourComponentName.html
                └──yourComponentName.css

Add a microservice

The following command creates a boilerplate for your service:

> finsemble-cli add service <yourServiceName> --create-client=true

Use --create-client=true to automatically create the corresponding client API boilerplate.

    src/services/
        └──yourServiceName/
            └──yourServiceName.html
            └──yourServiceNameService.js
    src/clients/
        └──yourServiceNameClient.js

Further reading

If you haven't yet installed the Finsemble seed project and gotten access to the CLI, you can do so by reading Getting Started.

You can learn more about the React controls and sample components we've made by checking out Presentation Components.