elpacman -- a command-line package manager for Emacs

3 min read

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 idempotent shell scripts.

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 idempotent 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.

For that reason I’ve created elpacman – a command-line package manager for Emacs.

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, and it comes with a nice command-line interface. Installing it as easy as simply dropping it in your $PATH.

Having a CLI tool to manage my Emacs packages I can now schedule periodic upgrades, check for outdated packages, and repair broken packages, if there are such.

elpacman is hosted on Github, so make sure to check the documentation for more details and examples.

Written on August 16, 2026