Overview

The FaaS Command Line Interface (CLI) is an open-source command-line tool provided by LivePerson that enables developers to create, edit and process their functions on their local development machines, in their favorite IDE of their choice. That way it’s very easy to keep the source code under version control in any Source Control Management (SCM).

The CLI offers nearly all functionality from the platfrom (e.g. deploy, undeploy and invoke).

Besides that it offers many commands to support developers during the development of a function (e.g. pull, push and debug).

Get started

To start and get known to the usage of the CLI please visit npmjs. Once you have the CLI installed simply use lpf -h to peruse the CLI's options.

If you have any suggestions or improvements please let us know under Issues.

Commands

Command Description
Init Initialize the project with the necessary files.
Login Performs the login with Conversational Cloud Credentials.
Logout Performs the logout.
Create Creates either functions or schedules
Add Adds domains to the currently logged account.
Pull Pulls a function from LivePerson Functions.
Push Pushes a function to LivePerson Functions.
Deploy Deploys a function on LivePerson Functions. If the passed function is already deployed, it will be redeployed.
Undeploy Undeploys a function on LivePerson Functions.
Invoke Invokes a function (remote or local).
Debug Starts a debug port in the range of 30500 - 31000 for a passed function.
Get Gets information about the passed domain. Possible domains are deployments, functions and account.
Help Shows help for the cli and the supported commands.
Autocomplete Displays autocomplete instructions (only supports zsh and bash).
Version Shows the current installed version.

Example with login

LivePerson Functions CLI Login

Example with pull

LivePerson Functions CLI Pull

SSO Support

Currently, the CLI login is restricted to the user login method. To use the login with an SSO enabled account you have to fetch the token and userId from the FaaS UI.

It is advisable to create a separate account for the CLI, because with each new login on a different page the token expires in the CLI (only one login per account is possible).

To get the token and the userId follow these steps:

  1. Open the FaaS UI and log in.
  2. Open the developer tools of your browser.
  3. Go to the 'Application' tab.
  4. Open the session storage with the key 'houston.'.
  5. Copy token and userId.
    • Token: 'glob'
    • UserId: 'config.userId'

    LivePerson Functions CLI token

  6. Run the login command as follows: lpf login --token <bearer> --accountId <accountId> --userId <userId>

Note: If you get a message that the token is not valid anymore, you have to perform step 1 - 6 again.

Snippets

Using the init command will also create an .idea folder in your project directory. These folders contain the same snippets you'll find in our online UI. We offer these snippets for both vscode and intellij idea/webstorm. The IDEs should automatically detect the snippets files once you open your initialized projects as a workspace. If not you can check out vscode's or intellij's documentations respectively on how to add them manually.