Introduction
- Provided by: elvish (Version: 0.13+ds1-2ubuntu0.1)
- Report a bug
epm:install &silent-if-installed=$false $pkg...
Install the named packages. By default, if a package is already installed, a message will be shown. This can be disabled by passing &silent-if-installed=$true, so that already-installed packages are silently ignored.
epm:installed
Return an array with all installed packages. epm:list can be used as an alias for epm:installed.
epm:is-installed $pkg
Returns a boolean value indicating whether the given package is installed.
epm:metadata $pkg
Returns a hash containing the metadata for the given package. Metadata for a package includes the following base attributes:
Additionally, packages can define arbitrary metadata attributes in a file called metadata.json in their top directory. The following attributes are recommended:
epm:query $pkg
Pretty print the available metadata of the given package.
epm:uninstall $pkg...
Uninstall named packages.
epm:upgrade $pkg...
Upgrade named packages. If no package name is given, upgrade all installed packages.
Package names in epm have the following structure: domain/path. The domain is usually the hostname from where the package is to be fetched, such as github.com. The path can have one or more components separated by slashes. Usually, the full name of the package corresponds with the URL from where it can be fetched. For example, the package hosted at https://github.com/elves/sample-pkg (https://github.com/elves/sample-pkg) is identified as github.com/elves/sample-pkg.
Packages are stored under ~/.elvish/lib/ in a path identical to their name. For example, the package mentioned above is stored at ~/.elvish/lib/github.com/elves/sample-pkg.
Each domain must be configured with the following information:
epm includes default domain configurations for github.com, gitlab.com and bitbucket.org. These three domains share the same configuration:
{
"method": "git",
"protocol": "https",
"levels": "2"
}
You can define your own domain by creating a file named epm-domain.cfg in the appropriate directory under ~/.elvish/lib/. For example, if you want to define an elvish-dev domain which installs packages from your local ~/dev/elvish/ directory, you must create the file ~/.elvish/lib/elvish-dev/epm-domain.cfg with the following JSON content:
{
"method": "rsync",
"location": "~/dev/elvish",
"levels": "1"
}
You can then install any directory under ~/dev/elvish/ as a package. For example, if you have a directory ~/dev/elvish/utilities/, the following command will install it under ~/.elvish/lib/elvish-dev/utilities:
epm:install elvish-dev/utilities
When you make any changes to your source directory, epm:upgrade will synchronize those changes to ~/.elvish/lib.