TL;DR
I’ve been prototyping Atlas, a package index and CLI for Zig focused on package discovery, immutable release records, and managing build.zig.zon. It’s not a replacement for Zig’s package system, does not create its own configuration for packages, does not include a different installer, or anything like that. In essense, it’s how I think community-based package discovery/management in Zig should work.
I’m sharing it as an early idea/prototype and would like feedback from y’all. ![]()
Long(-er|-ish) form:
I’ve been enjoying Zig SO MUCH, but one thing I keep missing is package discovery. I used to use CPAN (for Perl) and such systems, essentially author-driven indexing systems. As an author, you upload a package and manage its listing, and users can search and download.
There are already some forms of it:
Other than Awesome Zig (which is a curated list), these are closer to package indexes, but I wanted to take a different approach. An index that is not tied to any hosting (GitHub, CodeBerg, BitBucket, etc.), has explicit package/release ownership concepts (that authors drive), stores release records, and provides a similar utility to cpan, yum, et. al. without trying to replace any of Zig’s existing package tooling.
The basic idea:
build.zig.zonremains the source of truth for dependencies andzigstill does fetching and installing.- Atlas helps discover packages, resolve package/release metadata, and handle dependency entries.
- Packages are not assumed to live on GitHub. You can host it anywhere. (In the future, maybe on Atlas too.)
- There are namespaces for packages, owned by users/projects/organizations.
- Top-level “aliases” can exist, but are assigned through open community curation (project tickets).
- Strict no AI policy, so the project is open and welcome to everyone.
- Obvious, but free and open in every regard (client, server, governance, etc.).
I named it Atlas (as in a map of the package world).
The model is:
- Packages live at package coordinates like
namespace/package(similar togh_user/gh_repo). - Releases live at release coordinates like
namespace/package@version. - Versions are not limited to semver.
- A release points to a source URL and Zig package hash, immutable once published.
- The CLI can look up packages and add dependencies to
build.zig.zon. - Top-level “aliases” to package/release coordinates, so people can use
httpzinstead of something likekarlseguin/http. - These help avoid typosquatting.
I already have an early prototype working that can:
- Register users (
atlas register-user my_user) - Register packages (
atlas register-pkg my_user/my_pkg) - add description, tags, etc. - Release packages (
atlas release my_user/my_pkg@1.2.3 https://codeberg/...) - Fetch release info (
atlas find my_user/my_pkg/atlas find my_user/my_pkg@2.1.1)- Search using package descriptions and tags not yet implemented
- Add dependencies to
build.zig.zon(atlas add my_user/my_pkg@1.1.2, useszig fetch)- Supports special names (
atlas add karlseguin/http --as httpz)
- Supports special names (
- Remove dependencies from
build.zig.zon(atlas rm httpz)
This is still rough, and I’m a Zig beginner (this project forcing me to learn so much). I’m not asking anyone to adopt it yet (or I would put it in “Showcase”), but I do want feedback!
I know I would want to have this tool, but I’m not sure what others think of it, and whether people have ideas and/or interested in collaborating on it.
So, what do you all think?