Command Reference
LPM login
Logs in to LPM with the user’s Github credentials. When running this command, the interactive prompts require that you specify a personal access token.
NOTE: if you are only using LPM to install packages, then your Personal Access Token can simply have package 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.
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 / Loupe
folder. 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 / _ARG
folder. - If it finds a library file (.lby), then the folder is treated as an individual library. The
package.json
is created from the .lby file, and is prepared for publishing. - If none of the above are found, LPM is initialized as a stand-alone package manager.
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.
This command can also be run without any package arguments; it then installs all packages already configured in the package.json
file.
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. Note that these are not currently removed from the AS project folders.
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 docs
Pulls up the documentation for this package in a webpage. This is taken from Loupe’s public style guide.
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
and package-lock.json
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 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 allows most NPM commands to be specified in addition to the ones explicitly mentioned above. Try it out! Things like LPM update
or LPM explain piper
might work. Generally, NPM commands that don’t require arguments other than package names are probably safe.