elpacman -- a command-line package manager for Emacs
My home lab machines are running a mix of GNU/Linux, FreeBSD, and macOS and over the years I have accumulated a decent amount of shell scripts and tools, which eventually got refined as my personal Configuration Management system for keeping these systems up-to-date and sync configs between them easily.
Years ago I used to be managing all that using tools like CFEngine, Puppet, Ansible, etc. These days I enjoy having a dependency-less system where everything is driven by pure shell scripts with some shell helpers in the mix.
This is not to say that there is anything wrong with CFEngine, Puppet, Ansible and the rest, but for my use case – it makes a lot of sense, since I have removed a fair amount of dependencies and maintenance of my machines by simply switching to shell scripts for everything related to my personal home lab.
Emacs comes with an interactive package menu buffer for managing your packages. Emacs users usually manage their set of packages via the use-package macro.
Since I run Emacs on all my machines I needed a way to easily upgrade my Emacs packages as part of a regular operating system upgrade, which is driven by my home-made configuration management system.
And while you can easily do that by using Emacs itself in order to run an Elisp script from the command-line, it would be much better, if there was a full-featured package manager for it.
For that reason I’ve created elpacman – a command-line package manager for Emacs packages.
elpacman -- a command-line package manager for Emacs
Usage:
elpacman <sub-command> [arguments...]
Sub-commands:
update Refresh the local package database from the archives
upgrade [PKG...] Upgrade all packages, or only the named ones
install PKG... Install one or more packages
install --vc URL Install a package from a version-control URL
delete PKG... Delete one or more installed packages
search TERM... Search the archives for packages
info PKG Show detailed information about a package
list List installed packages
outdated List packages for which an upgrade is available
check Check for broken packages
repair Reinstall broken packages
recompile Recompile the byte-code of installed packages
autoremove Remove unused dependency packages
completions SHELL Print a completion script for bash or zsh
version Show the elpacman version
help Show this help text
Options:
-y, --yes, --assume-yes Do not prompt for confirmation
--vc With `upgrade', also upgrade version-controlled
packages (skipped by default)
elpacman does everything that you can do from an interactive Emacs session,
but it comes with a nice command-line, which you can simply drop in your $PATH
and use.
Having a CLI tool to manage my Emacs packages I can now schedule periodic upgrades, check for outdated packages, and repair a broken package, if there is one that needs fixing.
elpacman is hosted on Github, so make sure to check the documentation for more details and examples.