Zum Inhalt springen
Paketmanager

Paketmanager

Wir verwalten unsere Software-Umgebung mit dem Software-Umgebungsmanager pkgx.
Neben der Verwaltung von Software-Paketen ermöglicht pkgx eine einfache, nicht-hierarchische Verwaltung von Umgebungsvariablen auf Projektebene.

Voraussetzungen

Den Befehl sudo installieren, falls er noch nicht verfügbar ist (z. B. in einem Container).

# (command -v sudo) || (apt update && apt -y install sudo)

Den Befehl curl installieren, falls er noch nicht verfügbar ist.

$ (command -v curl) || ( sudo apt update && sudo apt -y install curl )

pkgx

Installation

Den Befehl pkgx installieren.

~ $ curl https://pkgx.sh | sh
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100  3485  100  3485    0     0   9146      0 --:--:-- --:--:-- --:--:--  9171
installing: /usr/local/bin/pkgx
######################################################################## 100.0%
pkgx 2.7.0
pkgm 0.11.1
mash 0.4.0
now type: pkgx --help
~ $ pkgx --help
usage:
  pkgx [+pkg@x.y…] <program|path> [--] [arg…]

examples:
  $ pkgx gum format "# hello world" "sup?"
  $ pkgx node@18 --eval 'console.log("hello world")'
  $ pkgx +openssl cargo build

modes:
  $ pkgx --query bun  # could you run `bun`? (-Q)
  $ pkgx --help       # hi mom!
  $ pkgx --version

flags:
  -q,  --quiet      # suppress brief informational messages
  -qq, --silent     # no chat. no errors. just execute.
  -j,  --json=v2    # output JSON (if sensible)
  -C,  --chdir <d>  # change directory first
  --sync            # sync first (note: rarely if ever needed)
  -v                # print version and continue

more:
  $ xdg-open https://docs.pkgx.sh

Integration

pkgx in die Shell integrieren.

~ $ pkgx integrate
/Users/david_delavennat/.zshrc << `source <(pkgx --shellcode)`
/Users/david_delavennat/.bashrc << `eval "$(pkgx --shellcode)"`
/Users/david_delavennat/.bash_profile << `eval "$(pkgx --shellcode)"`
restart your terminal for `pkgx` hooks to take effect

Mit pkgx installieren.

~/tp/ $ pkgx install github.com/mikefarah/yq
pkgx: installed: ~/.local/bin/yq

Verwendung

Um die in einer pkgx.yaml-Datei definierte Entwicklungsumgebung nutzen zu können, muss zuvor der Befehl dev ausgeführt werden.