Coder Social home page Coder Social logo

jpikl / pm Goto Github PK

View Code? Open in Web Editor NEW
6.0 5.0 0.0 278 KB

Package manager wrapper (supports: pacman, paru, yay, apt, dnf, zypper, apk, brew, scoop)

License: MIT License

Shell 100.00%
apt cli dnf fzf package-management package-manager pacman wrapper yay paru

pm's Introduction

pm

Wrapper around various package managers with unified CLI.

  • Supports: pacman, paru, yay, apt, dnf, zypper, apk, brew, scoop.
  • Interactive package selection using fzf with package info preview.
  • A single self-contained script. Just copy it somewhere on the $PATH and you're good to go.
  • POSIX compliant (will run literally everywhere).

Demo usage

Usage

Run pm help for the usage:

Package manager wrapper (supports: paru yay pacman apt dnf zypper apk brew scoop)

Usage: pm <command>

Commands:
  i,  install          Interactively select packages to install.
  i,  install <pkg>... Install one or more packages.
  r,  remove           Interactively select packages to remove.
  r,  remove <pkg>...  Remove one or more packages.
  u,  upgrade          Upgrade all installed packages.
  f,  fetch            Update local package database.
  n,  info <pkg>       Print package information.
  la, list all         List all packages.
  li, list installed   List installed packages.
  sa  search all       Interactively search between all packages.
  si  search installed Interactively search between installed packages.
  w,  which            Print which package manager is being used.
  h,  help             Print this help.

Features

STDIN filter

Interactive commands can read additional filters from standard input.

  • Each line is a regular expression (POSIX extended), matching whole package name.
  • Hash sign # indicates the start of a comment (which is ignored).
echo "bat" >> favorite_pkgs.txt
echo "fzf" >> favorite_pkgs.txt
echo "ripgrep" >> favorite_pkgs.txt

# Interactively select favorite packages to install
pm install < favorite_pkgs.txt

AUR helpers

On Arch Linux, pm allows easy installation of selected AUR helpers.

Just run pm install <aur-helper> where <aur-helper> is one of paru, yay or their binary variant (paru-bin, yay-bin).

These AUR helpers will be then used as the prefered package manager over pacman.

Configuration

Configuration is done through the following environment variables

PM

Enforces use of a specific package manager.

Options: paru, yay, pacman, apt, dnf, zypper, apk, brew, scoop.

The default package manager is auto detected by checking presence of the binaries listed above (in that particular order).

pacman pm install fzf    # Will auto detect package manager
PM=pacman pm install fzf # Will use pacman
PM=yay pm install fzf    # Will use yay

PM_COLOR

Controls color output for non-interactive commands.

Options: auto, always, never.

The default is auto which outputs colors only when STDOUT is a TTY.

FAQ

How to select multiple packages in interactive mode?

Use the TAB key to (un)select multiple packages.

See fzf docs for more keyboard shortcuts.

Is this better than my package manager?

Probably not, but it could be more convenient in some cases:

  1. If you often switch between distros and you do not want to remember every package manager CLI.
  2. Interactive package selection really helps when you are searching for a package to install and you do not know the exact name.

Can you support package manager XYZ?

Just create an issue for the support and I will look into that.

License

pm is licensed under the MIT license.

pm's People

Contributors

jpikl avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

pm's Issues

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.