Install lightctl

  1. Install lightctl with the following command:
    pip install lightctl==1.0.0
    
  2. Download an API credential from your Lightup instance by clicking Settings > API Credentials at the bottom of the left pane. Place the downloaded file, lightup-api-credentials.json, somewhere on your file system.
  3. By default lightctl will look for the credentials file in this location: $HOME/.lightup/credential. You can create a .lightup directory under your home directory, copy the lightup-api-credentials.json credential file there and rename it credential. Or, export the path to the file via the LIGHTCTL_CREDENTIAL_PATH environment variable. If your API credentials file is on your Desktop and you are running on a Mac, you'd use the command
    export LIGHTCTL_CREDENTIAL_PATH=~/Desktop/lightup-api-credential.json
    
  4. To test that your installation works, start python in a command shell and run the following code— it should output a python list of the workspaces that you can access in your Lightup instance.
    >>> from lightctl.client.workspace_client import WorkspaceClient
    >>> WorkspaceClient().list_workspaces()