Configure and manage your Incident Response CLI connection profiles

Create a connection profile to connect with your instance, view connection profiles, refresh your connection and available commands, or delete profiles you no longer need.

Before you begin

Role required: Responder, Manager, or Administrator

About this task

The Incident Response CLI stores profile information in a config.json file which, by default, is stored in your home directory at the following path:
  • Linux and Mac: ~/.lightstep/config.json
  • Windows: %USERPROFILE%\.lightstep\config.json

The CLI uses this file to determine what information to use to connect to an instance, and what settings to use to generate output. By default, the Incident Response CLI uses the settings found in the default profile to connect to an instance. To use alternate settings, you can create and reference additional named profiles.

The following example shows a  configuration  file with a default profile and a named profile. Each profile can use different credentials and specify different hosts and output formats.

{
   "profiles":{
      "default":{
         "host":"https://myinstance.lightstep.com",
         "loginmethod":"basic",
         "username":"admin",
         "output":"json",  
         "hostversion":"Paris",
         "appversion":"1.0"
         },
      "user1":{
         "host":"https://otherinstance.lightstep.com",
         "loginmethod":"basic",
         "username":"user1",
         "output":"yaml",
         "hostversion":"Paris",
         "appversion":"1.0"
         }
      }
}
Note: Sensitive credential information is only stored in the OS keychain, not in the configuration file.

Create a default profile

Create a connection profile that the Incident Response CLI uses by default. You must create a default profile to set up the CLI's initial connection with an instance.

About this task

By default, the information in this profile is used when you run a command that does not explicitly specify a profile to use.
Note: Sensitive credential information is only stored in the OS keychain, not in the configuration file.

Procedure

  1. Open the command-line interface to execute the following command:
    $ lightstep configure profile set
    The CLI prompts you for information.
  2. Enter the requested values.
    The CLI displays current values in brackets []. To keep an existing value, press the Enter key.
    Requested information Description
    Host The host name of the instance to connect to. Supports both the full URL (https://my-instance.lightstep.com) or just the host name (my-instance).
    Login method The login method to use to connect to the instance. Supports Basic, OAuth, and OAuth + MFA.
    Username The user name to use to connect to the instance.
    Password The password to use to connect to the instance.
    Client id The client id to use to connect to the instance when the login method is OAuth or OAuth + MFA.
    Client secret The client secret to use to connect to the instance when the login method is OAuth or OAuth + MFA.
    Authentication code The authentication code to use to connect to the instance when the login method is OAuth + MFA.
    Default output format Specifies how to format the command results. Options are json, yaml, text, and table.
    $ lightstep configure profile set
    
    Host: 
    https://myinstance.lightstep.com
    
    Login Method (Basic, OAuth, OAuth + MFA): 
    Basic
    
    Username: 
    myusername
    
    Password: 
    mypassword
    You can run any command using the values specified in your default profile by omitting the --profile attribute from your command.
    For example, the following command creates an alert in the instance specified in the default profile with the specified connection options.
    $ lightstep alert create

Create a named profile

Create a named connection profile to use with specific commands. This allows you to specify a different instance or connection protocol for a specific command.

Before you begin

A default profile must first exist to communicate with an instance.

About this task

Note: Sensitive credential information is only stored in the OS keychain, not in the configuration file.

Procedure

  1. Open the command-line interface to execute the following command:
    Specify the name of the named profile in the profile-name argument.
    $ lightstep configure profile set [--profile profile-name]

    The CLI prompts you for information.

  2. Enter the requested values.
    The CLI displays current values in brackets []. To keep an existing value, press the Enter key.
    Requested information Description
    Host The host name of the instance to connect to. Supports both the full URL (https://my-instance.lightstep.com) or just the host name (my-instance).
    Login method The login method to use to connect to the instance. Supports Basic, OAuth, and OAuth + MFA.
    Username The user name to use to connect to the instance.
    Password The password to use to connect to the instance.
    Client id The client id to use to connect to the instance when the login method is OAuth or OAuth + MFA.
    Client secret The client secret to use to connect to the instance when the login method is OAuth or OAuth + MFA.
    Authentication code The authentication code to use to connect to the instance when the login method is OAuth + MFA.
    Default output format Specifies how to format the command results. Options are json, yaml, text, and table.
    $ lightstep configure profile set --profile user1
    
    Host: 
    https://mytestinstance.lightstep.com
    
    Login Method (Basic ,OAuth ,OAuth + MFA): 
    Basic
    
    Username: 
    myusername
    
    Password: 
    mypassword
    You can run any command using the values specified in your named profile by adding the  --profile  <profile-name> attribute to your command.
    For example, the following command creates an alert in the instance specified in the user1 profile with the specified connection options.
    $ lightstep alert create --profile user1

View profiles

View all connection profiles set in the configuration file, or view information about a specific profile.

Before you begin

A default profile must first exist to communicate with an instance.

About this task

For each profile, the CLI displays host information, version details, user name, login method, and preferred output format. It does not display sensitive information such as passwords or client IDs.

Procedure

Open the command-line interface to execute the following command:
Include the [--profile profile-name] argument to view the connection information for a single profile. Otherwise, the CLI lists information for all profiles.
$ lightstep configure profile list [--profile profile-name]

This command displays all configured profiles.

$ lightstep configure profile list

The CLI provides the following output:

{
   "profiles":{
      "default":{
      "host":"https://myinstance.lightstep.com",
      "loginmethod":"basic",
      "username":"admin",
      "output":"json",
      "hostversion":"Paris",
      "appversion":"1.0"
   }
}

Remove a profile

Remove a named connection profile that you no longer need from the configuration file.

Before you begin

A default profile must first exist to communicate with an instance.

About this task

You cannot remove the default connection profile using this command. To remove the default connection profile, edit the configuration file manually.

Procedure

Open your system's command-line tool and execute this command. Specify the name of the named profile in the profile-name argument.
$ lightstep configure profile remove [--profile profile-name]

Results

The CLI removes the specified profile from the configuration file.

Refresh your connection

Update the available commands from the instance for the given profile. Refresh your connection after modifying any of the commands on the corresponding instance in order to keep the CLI up-to-date.

Before you begin

A default profile must first exist to communicate with an instance.

Procedure

Open your system's command-line tool and execute this command.
Include the [--profile profile-name] argument to refresh connection information from a named profile. If you do not include the argument, the CLI refreshes the default profile.
$ lightstep configure profile refresh [--profile profile-name]

Results

The CLI connects to the instance in the designated connection profile and updates any commands that may have changed.