This document gives a brief introduction to installing Hermit and using a newly created environment.
Installing Hermit is straightforward:
curl -fsSL https://github.com/cashapp/hermit/releases/download/stable/install.sh | /bin/bash
This will download and install
~/bin. You should add this to your
$PATH if it isn't already.
Also consider installing the shell hooks to get automatic environment activation/deactivation when changing directories.
Change into a project directory and run the following:
~$ cd ~/project ~/project$ hermit init info: Creating new Hermit environment in /home/user/project ...
At this point the Hermit environment should be initialised and the
directory should contain something like the following:
README.hermit.md activate-hermit hermit hermit.hcl
Activating an environment will add its
bin directory to your
well as setting any environment variables managed by Hermit.
To activate a Hermit environment source the
~/project$ . ./bin/activate-hermit Hermit environment /home/user/project activated project🐚~/project$
Once activated the shell prompt will change to include the prefix
At this point you can use and manage packages in this environment.
Once your environment is activated, use
hermit search to search for
packages. Without arguments it will list all known packages, or you may pass
a term to search in package names and descriptions.
project🐚~/project$ hermit search openjdk openjdk (11.0.11_9-zulu11.48.21, @stable, @zulu, 11.0.8_10, 11.0.9_11, 11.0.10_9) Java is a class-based, object-oriented programming language.
After you've selected the package you'd like to install into your environment,
hermit install to install packages:
project🐚~/project$ hermit install go-1.16.3 project🐚~/project$ go version go version go1.16.3 darwin/amd64
Refer to the package management documentation for more details, including how to uninstall, information about channels, etc.
When an environment is activated, Hermit inserts a shell function
deactivate-hermit. Call this to deactivate the current environment.
project🐚~/project$ deactivate-hermit Hermit environment /home/user/project deactivated ~/project$