Skip to content

Latest commit

 

History

History
246 lines (186 loc) · 8.23 KB

LibMan-CLI-Reference.md

File metadata and controls

246 lines (186 loc) · 8.23 KB

This page provides a reference for the LibMan CLI (Library Manager Command Line Interface).

LibMan Commands

Usage: libman [options] [command]

Options:

--help|-hShow help information
--versionShow version information

The following commands are available on the LibMan tool:

Commands:

initCreate a new libman.json
installAdd a library definition to the LibMan.json file, and download the library to the specified location
uninstallDeletes all files for the specified library from their specified destination, then removess the specified library definition from libman.json
restoreDownloads all files from provider and saves them to specified destination
updateUpdates the specified library
cleanDeletes all library files defined in libman.json from the project
cacheList or clean libman cache contents

Use "libman [command] --help" for more information about a command.

Command Details

Help flag

Usage: --help|-h

Prints a list of all available LibMan verbs.
If parameter supplied, will print the full details of the supplied verb.

Examples:

  • libman --help
  • libman -h

Version flag

Usage: --version

Prints the current version of the LibMan executable.

Examples:

  • libman --version

Init

Usage: libman init [options]

Options:

--help|-hShow help information
--verbositySet the verbosity of output (eg. "normal", "detailed", "quiet")
--default-provider|-pThe provider to use if no provider is defined for a given library. (eg. “cdnjs”, “filesystem”)
--default-destination|-dThe path, relative to the current directory, where library files should be installed if no destination is defined for a given library.

Remarks:
Creates new libman.json in the current directory.
Will throw an error if libman.json already exists.
Will prompt for a defaulDestination if none provided.

Examples:

  • libman init (interactive)
  • libman init --default-provider "cdnjs"
  • libman init --version "1.0"
  • libman init --version 1.0 --default-provider cdnjs --default-destination script\libman

Install

Usage: libman install [arguments] [options]

Arguments:

libraryId Library to uninstall

Options:

--help|-hShow help information
--verbositySet the verbosity of output (eg. "normal", "detailed", "quiet")
--provider|-pProvider to use (if not specified, the default provider will be used)
--destination|-dLocation to install the library (if not specified, the default destination location will be used)
--filesThe files from the specified library to install (if not specified, all files from the library will be installed)

Remarks:
Adds the specified library definition to the libman.json and downloads the files to the destination specified.
Initializes a libman.json if one does not exist.
If no default provider exists, --provider option is required.
If no default destination exists, --destination option is required.
If no files are specified, the entire library is included.

Examples:

  • libman install jquery@3.2.1
  • libman install jquery --provider cdnjs --destination wwwroot\scripts\jquery --files jquery.min.js
  • libman install myCalendar --provider filesystem --files calendar.js --files calendar.css

Uninstall

Usage: libman uninstall [arguments] [options]

Arguments:

libraryId Library to uninstall

Options:

--help|-hShow help information
--verbositySet the verbosity of output (eg. "normal", "detailed", "quiet")

Remarks:
Deletes the library file/s from the specified destination, then remove the specified library config from libman.json. Will throw error if no libman.json in current folder
Will throw error if specified library doesn't exist
If there's more than one library with the same libraryId, you'll be prompted to choose.

Examples:

  • libman uninstall jquery
  • libman uninstall jquery@3.3.1

Restore

Usage: libman restore [options]

Options:

--help|-hShow help information
--verbositySet the verbosity of output (eg. "normal", "detailed", "quiet")

Remarks:
Downloads all files from provider and saves them to configured destination.
Will throw error if no libman.json in current folder
If a library specifies a provider, it will override the defaultProvider
If a library specifies a destination, it will override the defaultDestination

Update

Usage: libman update [arguments] [options]

Arguments:

libraryId Library to update

Options:

--help|-hShow help information
--verbositySet the verbosity of output (eg. "normal", "detailed", "quiet")
-preIf specified, the latest pre-release version of the library will be downloaded (where applicable)
--toThe version to update the library to (needs complete libraryid for the provider)

Remarks:
Updates the specified library to the latest version.
Error if no libman.json in current folder
Error if specified library doesn't exist
If there's more than one library with the same libraryId, you'll be prompted to choose.

Examples:

  • libman update jquery
  • libman update jquery --to 3.3.1
  • libman update jquery -pre

Clean

Usage: libman clean [options]

Options:

--help|-hShow help information
--verbositySet the verbosity of output (eg. "normal", "detailed", "quiet")

Remarks:
Deletes from the local project all library files defined in libman.json.
Deletes any folders that become empty after this operation.

Cache

Usage: libman cache [options] [command]

Options:

--help|-hShow help information
--verbositySet the verbosity of output (eg. "normal", "detailed", "quiet")

Commands:

cleanDelete all files from the local machine's LibMan cache.
listDisplay a list of all libraries that are stored in the local machine’s LibMan cache.

Cache Clean

Usage: libman cache clean [arguments] [options]

Arguments:

provider Provider for which the cache files should be cleaned.

Options:

--help|-hShow help information
--verbositySet the verbosity of output (eg. "normal", "detailed", "quiet")

Remarks:
Delete all files from the local machine's LibMan cache. (This is the local cache that's usually kept in the user's home directory.)

Cache List

Usage: libman cache list [arguments] [options]

Options:

--help|-hShow help information
--verbositySet the verbosity of output (eg. "normal", "detailed", "quiet")
--filesList files that are cached for each library.
--librariesList the libraries cached for each provider.

Remarks:
Lists the libraries in the local machine's LibMan cache. (This is the local cache that's usually kept in the user's home directory.)