More CLI

install [*@identities]

Note: The install process does not install anything until all phases have completed. So, if the user requested to install A, and A required module B: both would be downloaded, potentially built, tested, and installed -- but only if both passed all their tests. For example: if module A failed its tests, then module B would not be installed (even if it passed its own tests) unless forced.

[@identities] can take the form of a file path (starting with . or /), URNs, URLs, paths, or identities:

uninstall [*@identities]

Uninstall the specified distributions

Note: Requires a bleeding edge rakudo (not available in 6.c)

update

Update the package indexes for all Repository backends

Note: Some Repository backends, like the default Ecosystems, have an auto-update option in resources/config.json that can be enabled. This should be the number of hours until it should auto update based on the file system last modified time of the ecosystem json file location.

upgrade [*@identities] BETA

Upgrade specified identities. If no identities are provided, zef attempts to upgrade all installed distributions.

search [$identity]

How these are handled depends on the Repository engine used, which by default is Zef::Repository::Ecosystems>p6c<

Note that not every Repository may provide such a list, and such lists may only be a subset. For example: We may not be able to get a list of every distribution on metacpan, but we *can* get the $x most recent additions (we use 100 for now).

[@from] allows you to show results from specific repositories only:

zef --installed list perl # Only list modules installed by rakudo itself
zef list cpan # Only show available modules from the repository
zef list p6c # with a name field matching the arguments to `list`
zef list cached # (be sure the repository is enabled in config)

Set the env variable ZEF_BUILDPM_DEBUG=1 or use the --debug flag for additional debugging information.

Note: In the future, a more appropriate hooking solution will replace this.

look [$identity]

Fetches the requested distribution and any dependencies (if requested), changes the directory to that of the fetched distribution, and then stops program execution. This allows you modify or look at the source code before manually continuing the install via zef install .

Note that the path to any dependencies that needed to be fetched will be set in env at PERL6LIB, so you should be able to run any build scripts, tests, or complete a manual install without having to specify their locations.

This config is loaded, but it is not yet the chosen config! We check that temporary config's %config<RootDir> for valid json in a file named config.json (i.e. %config<RootDir>/config.json). This can be confusing (so it may go away or be refined - PRs welcome) but for most cases it just means $*HOME/.zef/config.json will override an installed zef configuration file.

To summarize:

You can edit the resources/config.json file before you install zef.

When you perl6 -I. bin/zef install . that configuration file be be used to install zef and will also be installed with zef such that it will be the default.

You can create a %config<RootDir>/config.json file.

Where %config<RootDir>` comes from the previously mentioned %?RESOURCES<config.json>'s RootDir field ($*HOME/.zef in most cases), to allow overriding zef config behavior on a per user basis (allows setting different --install-to targets for, say, a root user and a regular user). Since this new config file could have a different RootDir than the default config (used to find the new one in the first place) this behavior may be changed in the future to be less confusing.

You can override both of the previous entries by passing zef --config-path="$path" <any command>

Configuration fields

Basic Settings

RootDir - Where zef will look for a custom config.json file

TempDir - A staging area for items that have been fetched and need to be extracted/moved

DefaultCUR - This sets the default value for --install-to="...". The default value of auto means it will first try installing to rakudo's installation prefix, and if its not writable by the current user it will install to $*HOME/.perl6. These directories are not chosen by zef - they are actually represented by the magic strings site and home (which, like auto, are valid values despite not being paths along with vendor and perl)

Phases / Plugins Settings

These consist of an array of hashes that describe how to instantiate some class that fulfills the appropriate interface from Zef.pm (RepositoryFetcherExtractorBuilderTester)

FAQ

CPAN?

You can also use a beta version of MetaCPAN with --metacpan which uses Repository::MetaCPAN

$ zef --metacpan search Inline::Perl5

Proxy support?

All the default fetching plugins have proxy support, but you'll need to refer to the backend program's (wget, curl, git, etc) docs. You may need to set an ENV variable, or you may need to add a command line option for that specific plugin in resources/config.json

Custom installation locations?

Pass a path to the -to / --install-to option and prefix the path with inst# (unless you know what you're doing)