-
Notifications
You must be signed in to change notification settings - Fork 1.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
pkgx list-installed
#985
Comments
It's great to see that you're aiming to fully replace Homebrew with pkgx in your dotfiles! Your plan to automatically install missing tools and uninstall unwanted ones with pkgx sounds like a solid approach. If you're able to implement the functionality to fetch a list of installed packages and create a script like the one you've outlined, it would be a valuable contribution to the pkgx community. Keep up the good work, and feel free to create a pull request if you'd like to share your solution with the community!
|
That seems like something that could (and probably should) easily be added to https://github.com/pkgxdev/mash. In its simplest form, it's really something like |
I ended up with: $ grep -rIhoP 'exec pkgx \+\K[^ ]+' "${HOME}/.local/bin" | sort -u
bun.sh
crates.io/bat
crates.io/hyperfine
deno.land
github.com/hadolint/hadolint
github.com/helmfile/helmfile
jfrog.com/jfrog-cli
nodejs.org
opendev.org/git-review
rust-lang.org/cargo
werf.io Or the uncompressed variant: grep --recursive --binary-files=without-match --no-filename --only-matching --perl-regexp 'exec pkgx \+\K[^ ]+' "${HOME}/.local/bin" | sort --unique |
Here's an one-liner to uninstall all existing pkgx installed apps: $ grep -rIhoP 'exec pkgx \+\K[^ ]+' "${HOME}/.local/bin" | sort -u | xargs -r pkgx uninstall
uninstalled: deno.land
uninstalled: maven.apache.org
uninstalled: openjdk.org |
And just in case others may find it useful, I built logic in my dotfiles to automate management of pkgx installed stuff: |
Yeah we're leaning towards mash scripts for now here. I think for pkgx v2 the install command will become its own package built on |
I think that having something like this (also as a mash script) would be a significant usability improvement. There is already https://github.com/pkgxdev/mash/blob/main/scripts/pantry-inventory.ts, a few more similar scripts that are documented on the website would make the project much easier to use as a brew replacement. |
I'm aiming to fully replace Homebrew with pkgx in my dotfiles.
However, my dotfiles:
And in order to perform that with pkgx, I need to fetch a list of pkgs already installed. Something like:
The text was updated successfully, but these errors were encountered: