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.

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

Commands

Command Description
Init Initialize the project with the necessary files. If the project is already initialised it will add a new function.
Login Performs the login with LiveEngage Credentials.
Logout Performs the logout.
Pull Pulls a function from the LivePerson functions platform.
Push Pushes a function to the LivePerson functions platform.
Deploy Deploys a function on the LivePerson functions platform. If the passed function is already deployed, it will be redeployed.
Undeploy Undeploys a function on the LivePerson functions platform.
Invoke Invokes a function (remote or local).
Debug Starts a debug port in the range of 30500 - 31000 for a passed function.
Get Get 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.