Skip to content

Administration from the CLI

From the Lightrun CLI, managers can run administrator commands.

Permissions

Only users with ROLE_MANAGER can perform these actions.

Important

If the file name and line number don't match the bytecode version of the app, Lightrun will behave inconsistently and will most likely fail.

Set up your CLI

  1. Install the CLI

  2. Authenticate the CLI

To use the Lightrun CLI

Prerequisites

Sign up for your Lightrun account before getting started.

The Lightrun CLI requires Java be installed.

  1. Log in to your Lightrun account from the browser and navigate to Getting Started.

  2. Download lightrunc.jar from the landing page from the Command Line Tool section.

  3. Open the terminal and navigate to where you downloaded the file.

  4. Authenticate your CLI with your Lightrun account:

    1. Copy and run the first command line that appears in your browser.

      Example

      java -jar lightrunc.jar server-url https://2147483647.lightrun.com/company/acme
      
    2. Copy and run the second command line that appears in your browser.

      Example

      java -jar lightrunc.jar login myaccount@acme.com
      
  5. To run any Lightrun command, add the following prefix:

    java -jar lightrunc.jar
    
Authenticate the CLI with Lightrun

To use the CLI, first authenticate with your Lightrun account. You can authenticate directly from within the CLI or choose to redirect to the browser.

lightrunc.jar login <username/email address/password>

Example

Log in directly from the CLI:

java -jar lightrunc.jar login -email jane.doe@example.com -password secretpassword

Example

Log in with a redirect to your browser:

java -jar lightrunc.jar login myaccount@acme.com

Administrator commands

create-user

Description

create-user creates a new user based on the specified details.

Synopsis

lightrunc.jar create-user <Username> <FirstName> <LastName> <Email> <Role1> <Role2>...-companyName <CompanyName>

Options

Option Description
Username A unique name for the user
Email A valid and unique email address
Role Valid values:
ROLE_ADMIN
ROLE_MANAGER
ROLE_USER
ROLE_SET_VALUE
ROLE_IGNORE_QUOTA

Output and examples

Example

The following creates a new user with the User role for Dr. Dolittle with the user name dolittle when a Manager from the company DoctorCom runs the command.

java -jar lightrunc.jar create-user dolittle Dr. Dolittle dolittle@doctor.com ROLE_USER

When you press Enter, the terminal requests a password for the new user.

Enter a password, press Enter and the terminal prints:

User successfully created in company DoctorCom

delete-user

Description

Delete a specified user.

Note

The user must first be deactivated before they can be deleted. Deactivate directly from the Management Portal by navigating to Manager->User management.

Synopsis

lightrunc.jar delete-user <username>

Options

username - the email address associated with the user that is to be deleted

Warning

Once deleted, the user cannot be restored.

Output and examples

Example

java -jar lightrunc.jar delete-user SMITHJ@acme.com

​ The following is printed in the terminal: ​

 `User Deleted`

clear-exceptions

Description

Clear all exceptions from history.

Synopsis

lightrunc clear-exceptions

Options

None

Output and examples

The following output is printed:

Successfully cleared exceptions history from the server


Last update: September 27, 2021