Getting started with LPM

Installation

Prerequisites

LPM is meant to be run in a Windows environment.

You will need to have Python and Node.js (which includes NPM) installed locally. LPM ships as an npm package and uses Python under the hood, so both must be available on your PATH:

Authenticating with the GitHub package registry

LPM is published to Loupe’s organization on the GitHub npm registry as @loupeteam/lpm. Before installing it, you need to point the @loupeteam scope at the GitHub registry and provide a Personal Access Token that has the read:packages scope.

Create (or edit) a .npmrc file in your user profile directory (%USERPROFILE%\.npmrc on Windows) with the following contents:

@loupeteam:registry=https://npm.pkg.github.com
//npm.pkg.github.com/:_authToken=YOUR_GITHUB_TOKEN

Replace YOUR_GITHUB_TOKEN with a GitHub Personal Access Token (classic) that includes the read:packages scope. If you don’t have a GitHub account with access to Loupe’s packages, you can use Loupe’s default-user token, which grants read access to all of Loupe’s packages: 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.

Install LPM

Once your .npmrc is configured, install LPM globally with NPM:

npm install -g @loupeteam/lpm

The npm post-install step automatically creates a Python virtual environment inside the package and installs LPM’s Python dependencies into it. If you see an error about Python not being found, double-check that Python 3.8+ is installed and on your PATH, then re-run the install.

To upgrade LPM later, re-run the same command — npm will pull the latest published version.

Check the Installation

If the installation completed successfully, running lpm -v from a command prompt will return the current version of LPM.

Basic Usage

LPM is a command line tool that should be invoked from the root folder of your project (i.e. for an Automation Studio project this is the folder that contains your project’s .apj file). After a global install, lpm is on your PATH and accessible from any directory. Basic invocation works as follows:

lpm <command> [packages]

where <command> is one of the available commands described below, and packages is the name of the package you want to work with. Some commands accept an array of packages separated by spaces, and will act on all of them at once.

Logging In

After installation, log in to LPM so it can pull Loupe packages from the GitHub package registry:

lpm login

The login command is interactive, and prompts you to enter a token. This is a GitHub Personal Access Token. If you have a GitHub account with access to Loupe’s packages, you can generate your own token and enter it here. Otherwise, you can use the following default-user token, which will give you read access to all of Loupe’s packages: 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.

You can also pass the token non-interactively with --token:

lpm login --token YOUR_GITHUB_TOKEN

Once you log in to LPM on a workstation, your credentials are stored with your user. You can run LPM from any folder and it will remember the credentials you supplied.

Initializing your Folder

The next step is to create a new directory and initialize it for use with LPM:

mkdir test
cd test
lpm init

When prompted to set up an Automation Studio project, select Yes. This will automatically create a project in the current directory that will be ready to receive further packages.

Once the initialization is complete, LPM is ready to install packages into your project.

Install your First Package

Within the local directory that you just created, install the piperpkg package:

lpm install piperpkg

This pulls in several Loupe libraries and a few Loupe tasks, and inserts them automatically into your Automation Studio project. You can quickly open up your project from the command line via:

lpm as

This opens up the correct version of Automation Studio, and you can see within your Logical View the new assets that were added in by LPM.

Check LPM Status

You can check both the login and initialization status of LPM at any time:

lpm status

This will indicate whether or not you’re logged in, what user is logged in, and the status of the current directory.