Command Reference
Global flags
The following flags can be passed at the top level (lpm --silent install) or after the subcommand (lpm install --silent):
-s,--silent: execute commands with default values and no operator prompts. Required for non-interactive CI scenarios.-nc,--nocolor: disable colored output (useful for log files and CI environments).-v,--version: print the LPM version and exit.
LPM login
Logs in to LPM with the user’s GitHub credentials. When running this command interactively, you will be prompted for a Personal Access Token. You can also pass the token non-interactively via --token:
lpm login --token YOUR_GITHUB_TOKEN
When combined with --silent, --token is required.
NOTE: if you are only using LPM to install packages, then your Personal Access Token can simply have the read:packages scope. If you also want to publish packages to LPM, you will need to add the write:packages scope to your Personal Access Token.
LPM logout
Logs out of LPM. This command always runs, even if there are no valid credentials to clear, so it is safe to use to clean up stale state.
LPM status
Reports the overall authentication status of LPM (logged in or not, and the name of the authenticated user), along with initialization status of the local directory.
lpm status
-> Logged in: Yes
-> Current user: JaneDoe
-> Local directory status: Not initialized for use with lpm
LPM init
Initializes the current folder for other LPM commands. This creates the package.json file, and intelligently parses the local folder to determine which of the following apply:
- If it finds an Automation Studio project file (.apj), then the folder is treated as a full project. The user has the option to initialize LPM by importing the libraries that are currently in the
Logical / Libraries / Loupefolder. This is useful if a project already has Loupe libraries in it, and you want to let LPM manage these moving forward. For legacy purposes it will also attempt to scan theLogical / Libraries / _ARGfolder. - If it finds a library file (.lby), then the folder is treated as an individual library. The
package.jsonis created from the .lby file, and is prepared for publishing. - If none of the above are found, LPM offers to bootstrap a starter AS project, or you can decline the prompt to initialize the directory as a stand-alone package manager.
You can force a specific mode with -prj / --asproject or -lib / --aslibrary if auto-detection would otherwise pick the wrong one.
LPM configure
Configures deployment targets and the Git client for the current project. This updates the lpmConfig section of package.json. Use this after lpm init if you want LPM to automatically deploy installed packages to one or more Automation Studio configurations.
LPM install
Installs the specified packages. The packages specifier can include more than one package. If the package name alone is specified, LPM will fetch the latest version available. You can specify a different version like so: lpm install piper@1.0.1.
The install command fetches one or more specified packages, along with their full dependency tree, syncs them into the project’s Logical View, and deploys them to any configurations registered via lpm configure.
This command can also be run without any package arguments; it then installs, syncs, and deploys every package already configured in the package.json file. This is the canonical way to hydrate a freshly cloned project.
Pass -src / --source to install libraries as source instead of as binaries. This is useful when you want to debug or modify a library locally. The lpm git command can then be used to open source-installed libraries in your configured Git client.
A complete list of available packages can be printed by running lpm viewall.
LPM uninstall
Removes the specified libraries from the package.json file and the node_modules folder, and re-syncs the project’s Logical View to reflect the removal.
LPM view / LPM info
Fetches information about the specified package. This includes latest version, documentation URL, and dependencies. This command can only act on a single package at a time.
You can also specify a sub-command like so:
lpm view piper dependencies
where dependencies can be any of the package’s attributes that are stored in its package.json file.
LPM viewall
Lists every Loupe package currently available in the registry, along with the latest version and the date of the most recent update.
LPM type
Prints the LPM package type (e.g. library, pkg, project, hmi) of the specified package or current directory. This command only accepts a single package at a time.
LPM docs
Pulls up the documentation for this package in a webpage. This is taken from Loupe’s public style guide.
LPM as
Opens the current Automation Studio project in the correct version of Automation Studio (based on the .apj file’s recorded AS version). If that version is not installed, LPM falls back to AS410.
LPM git
Opens the configured Git client (currently only Git Extensions is supported) for one or more source-installed packages. This is useful in tandem with lpm install --source, which installs packages as live Git clones rather than binaries. You must have run lpm configure and selected a Git client before running this.
LPM delete
Removes all LPM hooks from this project. Run this command if you no longer want LPM to manage packages in your project. This will remove the package.json, package-lock.json, and .npmrc files along with the node_modules folder from your project.
NOTE: this command will not remove any of the content from the Logical View. Whatever LPM has installed in there will remain after deletion.
LPM list
Lists the installed versions of all packages.
LPM debug
Prints the list of Loupe libraries that LPM has discovered in the project. Intended primarily for troubleshooting.
LPM publish
Publishes the contents of the current directory as a new package in the GitHub registry. The local package.json file determines the details of the published package, and should be updated accordingly prior to publishing. At a minimum the following fields should be configured correctly:
- name: this must include the correct scope prefix (
@loupeteam/) followed by the name of the package (i.e. the library name). - version: this must be the version of the package being published.
- repository: this must point to the GitHub repository that will be associated with this package.
- dependencies: this is a list of other LPM packages that this package depends upon (with optional version values).
NOTE: Running lpm init in this directory beforehand causes these fields to be automatically populated based on the .lby file in the case of a library.
LPM -v
Prints the current version of LPM.
LPM generic commands
LPM is a wrapper around NPM, and any subcommand not listed above is forwarded to npm as-is. Things like lpm update or lpm explain piper will pass straight through. Generally, NPM commands that don’t require arguments other than package names are probably safe.