Administration from the CLI¶
From the Lightrun CLI, managers can run administrator commands.
Permissions
Only users with ROLE_MANAGER
permissions 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¶
To use the Lightrun CLI¶
Prerequisites
Sign up for your Lightrun account before getting started.
The Lightrun CLI requires Java to be installed.
-
From a browser, log in to your Lightrun account and navigate to Getting Started.
-
From the Command Line Tool section in the landing page, download
lightrunc.jar
. -
Open the terminal and navigate to where you downloaded the
lightrunc.jar
file. -
Authenticate your CLI with your Lightrun account:
-
Copy and run the first command line that appears in your browser.
Example
java -jar lightrunc.jar login
Note: Add
server-url <URL>
at the end of the command when using Lightrun on-prem. -
Copy and run the second command line that appears in your browser.
Example
java -jar lightrunc.jar login myaccount@acme.com
-
-
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.
java -jar 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¶
java -jar lightrunc.jar create-user <Username> <FirstName> <LastName> <Email> <Role1> <Role2>...-companyName <YOUR_COMPANY_NAME>
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¶
java -jar 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
User Deleted
clear-exceptions
¶
Description¶
Clear all exceptions from history.
Synopsis¶
java -jar lightrunc clear-exceptions
Options¶
None
Output and examples¶
The following output is printed to the terminal:
Successfully cleared exceptions history from the server