...OVERVIEW...
What it is
Package managers are good at installing things and bad at remembering why. They can list every package on the system, but that list includes hundreds of dependencies you never asked for. When you want to clean up, you are left guessing which packages were your decisions.
rempkg is a thin wrapper. It passes your command through to the real package manager, watches what happened, and writes down the packages you installed by hand. No lock-in, no daemon, no database: just a JSONC file you can read, edit and version.
What gets recorded
Each entry stores the package name, the manager, optional tags, the install timestamp and the original command. Install verbs such as -S, install and add upsert entries; remove verbs such as -R, remove and uninstall untrack them. Query and update operations are passed through and never tracked.
Tags are the useful part. --tag delete-later --tag tool pacman -S cowsay turns a flat list into something you can act on, and --list --filter-tag delete-later answers the question you actually have.
Works with sudo, without the mess
The default tracking file is ~/rempkg/packages.jsonc, resolved to your home directory even when the command runs under sudo. That avoids the classic problem of root-owned state files in a user's dotfiles. REMPKG_FILE or --file can point somewhere else.
Installation is a single install.sh that builds the Go binary and puts it on your PATH. There are no runtime dependencies.
Why not just use the package manager?
Because the package manager's job is to make the system work, not to preserve the story of how it got there. rempkg keeps that story small and separate. It does not replace pacman or apt; it remembers what you asked them to do.