Decentralized, registry-free package management for Emacs 29+.
quelpa2 is a lightweight dependency-resolution layer built directly on top of Emacs's built-in package-vc-install. It eliminates the need for centralized recipe repositories by allowing Emacs Lisp packages to declare their own upstream coordinates and fallback dependency origins directly inside standard file headers.
Historically, installing Emacs packages directly from source repositories required maintaining centralized recipe registries—the problem original quelpa solved by fetching and building MELPA recipes locally.
With Emacs 29+, package-vc-install brought native version-control installation straight into core Emacs. However, package-vc-install still leaves two key gaps:
- No recursive VC dependency resolution: If Package A depends on Package B, and Package B is not on GNU ELPA or NonGNU ELPA,
package-vc-installfails unless you manually install Package B first. - External recipe dependency: Without a central registry, there is no standard place for a package to tell Emacs how to be built and where to fetch and build its dependencies from.
quelpa2 bridges this gap with zero external registries.
The vision: Every package carries its own self-contained origin metadata in its header comments—making the Emacs package ecosystem completely decentralized while remaining 100% backwards-compatible with existing Emacs tooling.
So far so good. Since this project has only just been started, almost no packages include the mentioned headers. Every maintainer that adopts these headers contributes to a truly decentralized Emacs ecosystem, but adoption could take a while. Who knows? People might not care and everything stays fragmented over different package managers, repositories etc. But it's worth a try, isn't it? So there you have it...
quelpa2 introduces two optional file headers alongside standard Package-Requires:
Package-Origin: Declares the package's own canonical source repository using the exact(name :url ...)specification format expected bypackage-vc-install.Package-Requires-Origins: Maps dependencies listed inPackage-Requiresto their upstream repository coordinates, used as a fallback when a dependency is not available in standardpackage.elarchives.
;;; my-pkg.el --- Example decentralized package -*- lexical-binding: t; -*-
;; Author: Your Name
;; Version: 1.0.0
;; Package-Origin: (my-pkg :url "https://github.com/username/my-pkg")
;; Package-Requires: ((emacs "29.1") (nav-flash "1.0.0"))
;; Package-Requires-Origins: ((nav-flash :url "https://github.com/steckerhalter/nav-flash"))
;;; Code:Package-Requiresstays untouched: Native Emacs tools, byte-compilers, and package linters continue to work normally without modification.- EAFP (Easier to Ask for Forgiveness than Permission): When resolving a dependency from
Package-Requires,quelpa2first attempts a standardpackage-installfrom configured archives (ELPA/NonGNU ELPA). - Decentralized Fallback: If the dependency is not found in standard archives,
quelpa2looks up the package inPackage-Requires-Originsand recursively installs it viapackage-vc-install—inspecting that package's headers in turn. - Remote
HEADby default: Omitting:branchlets Git automatically track the remote repository's defaultHEAD(e.g.,master), though:branchor:revcan be passed explicitly in any plist when pinning is required.
- Emacs 29.1 or later (requires built-in
package-vc). - Git (or the relevant VCS backend) available in your
exec-path.
You can bootstrap quelpa2 directly using Emacs's built-in package-vc-install:
(unless (package-installed-p 'quelpa2)
(package-vc-install '(quelpa2 :url "https://github.com/quelpa/quelpa2")))Or with use-package (Emacs 29+):
(use-package quelpa2
:vc (:url "https://github.com/quelpa/quelpa2"))Optional Dependency: pvrecipe
The library pvrecipe can be installed and enabled to look up MELPA recipes and translate
them into package-vc specifications, so dependencies without a Package-Requires-Origins
entry can still be resolved and installed. This eases the migration to quelpa2 before the new
headers are adopted by the packages themselves. For example,
back-button declares:
;; Package-Requires: ((nav-flash "1.0.0") (smartrep "0.0.3")
;; (list-utils "0.4.2") (persistent-soft "0.8.8")
;; (pcache "0.2.3"))That is five dependencies, none of which ship in a configured archive. Without pvrecipe you
would have to install each of them manually — in the right order — before installing
back-button, because quelpa2 can only fall back to origins the package itself declares in
Package-Requires-Origins. With pvrecipe, the MELPA recipes are fetched and translated on
the fly.
UPDATE: back-button has adopted the new headers and it can be installed directly with quelpa2 without pvrecipe!
To install pvrecipe with quelpa2 and keep it updated:
(quelpa2 '(pvrecipe :url "https://github.com/quelpa/pvrecipe" :update t))The fallback is disabled by default, so quelpa2 stays purist unless you opt in:
(setq quelpa2-use-pvrecipe t)Once enabled, the MELPA-recipe fallback is active in quelpa2. :update t matters because
pvrecipe tracks MELPA's recipe formats, so a stale copy can translate newer recipes
incorrectly. Make sure the install and the setq run before you install packages that depend
on the fallback.
quelpa2-use-pvrecipe is only the default. The :vcrecipe keyword on a specification
overrides it for that installation and its recursive dependency resolution:
;; Never fall back to a MELPA recipe for this installation, even if the
;; global default is enabled.
(quelpa2 '(back-button :url "https://github.com/example/back-button" :vcrecipe off))
;; Always use the fallback for this installation, even if the global default
;; is disabled.
(quelpa2 '(some-package :url "https://github.com/example/some-package" :vcrecipe on))on and off are the canonical values; t and nil work as synonyms. The keyword only
affects dependency resolution — it is not passed on to package-vc-install (like :update).
quelpa2 mirrors the argument signature of package-vc-install, accepting a package symbol, a URL string, or a full VC specification list:
(quelpa2 '(my-pkg :url "https://github.com/username/my-pkg"))If the package is already installed and includes a Package-Origin header (or exists in your configured package-archives), quelpa2 resolves its origin automatically:
(quelpa2 'quelpa2)Run M-x quelpa2 and enter a package name or repository specification to install and recursively resolve all dependencies.
Two flags control upgrades:
quelpa-self-update-p(defaultt): whetherquelpa2upgrades the installedquelpa2itself the first time it is called. Set it to nil to turn this off.quelpa2-update-p(defaultnil): whetherquelpa2upgrades already-installed packages. The per-specification:updatekeyword takes precedence, e.g.(quelpa2 '(foo :url "..." :update t)).
With the defaults, already-installed packages are left alone at startup.
quelpa2 uses Emacs's built-in ERT testing framework with isolated, temporary sandboxes so tests never affect your personal Emacs configuration or package-user-dir.
Use the included Makefile to run the test suite:
-
Run the full test suite (including live network & recursive dependency tests):
make test -
Run offline unit and sandbox tests only:
RUN_NETWORK_TESTS=0 make test -
Test against a specific Emacs binary:
EMACS=/path/to/emacs make test -
Clean up byte-compiled files:
make clean
- Offline Sandbox Tests: Verify header parsing (
Package-OriginandPackage-Requires-Origins), spec normalization, and local Git repository dependency chains without touching external networks. - Network Integration Tests: Pull pinned revisions of real repositories (such as
quelpa-use-packageandnav-flash) to validate end-to-endpackage-vccheckout and recursive resolution in the wild.
quelpa2 is developed as a standalone, modern foundation designed to eventually serve as the next-generation backend for quelpa, allowing existing users to transition smoothly from recipe-based builds to native package-vc workflows.
GPL-3.0-or-later (same as GNU Emacs).