Skip to content
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

add cli tool to list packages currently installed in an instance #223

Open
line-o opened this issue Feb 24, 2022 · 3 comments
Open

add cli tool to list packages currently installed in an instance #223

line-o opened this issue Feb 24, 2022 · 3 comments

Comments

@line-o
Copy link
Member

line-o commented Feb 24, 2022

Possible names:

  • exist-package
  • exist-pkg
  • expath-pkg
exist-pkg [options]

Should return tabulated list with package-abbreviation and version.

Example Output:

package-service  1.2.39
dashboard        10.3.2
monex             3.0.3
html-templating   1.0.4
eXide             3.0.1

Possible options:

  • --libraries, -l or -L: list only installed libraries
  • --applicationts, -a or -A: list only installed applications
  • --filter, -f: list only libraries and/or applications that match a given pattern
  • --extended, -e: add more information to the result (date of installation, namespace URI, declared dependencies, ...)
  • --json, -j: return result as json (in order to pipe it to jq for example or store it in a file)
@line-o line-o added enhancement cli command line tool related issues labels Feb 24, 2022
@joewiz
Copy link
Member

joewiz commented Feb 24, 2022

@line-o I'm sure you've got a bunch of package managers that you're modeling this on, but for what it's worth, here's the one I'm most familiar with: homebrew. The brew list command lists installed formulae and/or casks (somewhat analogous to our two types of packages - applications and libraries), and can show them with or without version numbers (without being the default), in a multicolumn or one-per-line layout (multicolumn being the default).

% brew list --help    
Usage: brew list, ls [options] [installed_formula|installed_cask ...]

List all installed formulae and casks.

If formula is provided, summarise the paths within its current keg. If cask
is provided, list its artifacts.

      --formula, --formulae        List only formulae, or treat all named
                                   arguments as formulae.
      --cask, --casks              List only casks, or treat all named arguments
                                   as casks.
      --unbrewed                   List files in Homebrew's prefix not installed
                                   by Homebrew. (disabled; replaced by
                                   brew --prefix --unbrewed)
      --full-name                  Print formulae with fully-qualified names.
                                   Unless --full-name, --versions or
                                   --pinned are passed, other options (i.e.
                                   -1, -l, -r and -t) are passed to
                                   ls(1) which produces the actual output.
      --versions                   Show the version number for installed
                                   formulae, or only the specified formulae if
                                   formula are provided.
      --multiple                   Only show formulae with multiple versions
                                   installed.
      --pinned                     List only pinned formulae, or only the
                                   specified (pinned) formulae if formula are
                                   provided. See also pin, unpin.
  -1                               Force output to be one entry per line. This
                                   is the default when output is not to a
                                   terminal.
  -l                               List formulae and/or casks in long format.
                                   Has no effect when a formula or cask name is
                                   passed as an argument.
  -r                               Reverse the order of the formulae and/or
                                   casks sort to list the oldest entries first.
                                   Has no effect when a formula or cask name is
                                   passed as an argument.
  -t                               Sort formulae and/or casks by time modified,
                                   listing most recently modified first. Has no
                                   effect when a formula or cask name is passed
                                   as an argument.
  -d, --debug                      Display any debugging information.
  -q, --quiet                      Make some output more quiet.
  -v, --verbose                    Make some output more verbose.
  -h, --help                       Show this message.
% brew list
==> Formulae
ant			gcc			libarchive		libunistring		openjdk			ruby-build
aom			gd			libass			libusb			openjdk@11		rumble
apache-spark		gdbm			libassuan		libuv			openjpeg		s3cmd
assimp			gdk-pixbuf		libb2			libvidstab		openssl@1.1		saxon
atomicparsley		gettext			libbluray		libvmaf			opus			sbt
autoconf		gh			libde265		libvorbis		p11-kit			sdl2
autoconf-archive	ghostscript		libebml			libvpx			pandoc			shared-mime-info
automake		giflib			libev			libx11			pango			six
basex			git			libevent		libxau			parallel		snappy
bdw-gc			glib			libffi			libxcb			pass			speex
boost			gmp			libgcrypt		libxdmcp		pcre			sqlite
brotli			gnu-getopt		libgpg-error		libxext			pcre2			srt
c-ares			gnupg			libheif			libxrender		pdftk-java		tcl-tk
ca-certificates		gnutls			libidn			libyaml			pillow			tesseract
cairo			gobject-introspection	libidn2			little-cms2		pinentry		texinfo
cjson			graphite2		libimagequant		lz4			pixman			theora
cmake			graphviz		libksba			lzo			pkg-config		tika
cmark			gts			liblqr			m4			pngcheck		tree
cmocka			guile			libmatroska		maven			pngquant		unbound
dav1d			handbrake		libmpc			mbedtls			poppler			unpaper
dbus			harfbuzz		libnghttp2		md4c			popt			utf8cpp
deno			hub			libogg			mkvtoolnix		pugixml			webp
docbook			hunspell		libomp			mp4v2			pybind11		wget
docbook-xsl		icu4c			libpng			mpdecimal		python@3.10		x264
double-conversion	imagemagick		libproxy		mpfr			python@3.8		x265
exiftool		imath			libpthread-stubs	nasm			python@3.9		xcinfo
fdk-aac			isl			libraqm			netpbm			qpdf			xmlto
ffmpeg			jasper			librist			nettle			qrencode		xorgproto
ffmpeg@4		jbig2dec		librsvg			nghttp2			qt			xvid
flac			jbig2enc		libsamplerate		nlohmann-json		rav1e			xxhash
fmt			jemalloc		libsndfile		npth			rbenv			xz
fontconfig		jena			libsodium		nspr			readline		youtube-dl
freetype		jpeg			libsoxr			nss			rename			zeromq
frei0r			jpeg-xl			libtasn1		ocrmypdf		rsync			zimg
fribidi			lame			libtiff			opencore-amr		rubberband		zstd
fuseki			leptonica		libtool			openexr			ruby

==> Casks
1password		camtasia		google-drive		mattermost		openvpn-connect		tower
adobe-acrobat-reader	cheatsheet		gpg-suite		microsoft-auto-update	oxygen-xml-editor	transmit
alfred			cyberduck		istat-menus		microsoft-edge		postman			tropy
amazon-chime		deepl			jedit			microsoft-office	proxyman		visual-studio-code
atom			discord			joplin			microsoft-teams		pycharm-ce		vlc
bbedit			docker			kaleidoscope		mimestream		qtpass			wkhtmltopdf
bookends		exist-db		keycue			ngrok			signal			zoom
boop			firefox			liberica-jdk8-full	nova			skype
calibre			github			libreoffice		obsidian		slack
camo-studio		google-chrome		maccy			openrefine		thunderbird
% brew list --versions
ant 1.10.12
aom 3.2.0_2
apache-spark 3.2.1
assimp 5.2.2
atomicparsley 20210715.151551.e7ad03a
autoconf 2.71
autoconf-archive 2022.02.11
automake 1.16.5
basex 9.6.4
bdw-gc 8.0.6
boost 1.78.0
brotli 1.0.9
c-ares 1.18.1_1
ca-certificates 2022-02-01
cairo 1.16.0_5
cjson 1.7.15
cmake 3.22.2
cmark 0.30.2
cmocka 1.1.5
dav1d 0.9.2
dbus 1.12.20
deno 1.19.0
docbook 5.1_1
docbook-xsl 1.79.2_1
double-conversion 3.2.0
exiftool 12.30
fdk-aac 2.0.2
ffmpeg 5.0-with-options_1
ffmpeg@4 4.4.1
flac 1.3.4
fmt 8.1.1_1
fontconfig 2.13.1
freetype 2.11.1
frei0r 1.7.0
fribidi 1.0.11
fuseki 4.4.0
gcc 11.2.0_3
gd 2.3.3_1
gdbm 1.23
gdk-pixbuf 2.42.6
gettext 0.21
gh 2.5.1
ghostscript 9.55.0
giflib 5.2.1
git 2.35.1
glib 2.70.4
gmp 6.2.1_1
gnu-getopt 2.37.4
gnupg 2.3.4
gnutls 3.7.3
gobject-introspection 1.70.0_3
graphite2 1.3.14
graphviz 2.50.0
gts 0.7.6_2
guile 3.0.8
handbrake 1.5.1
harfbuzz 3.4.0
hub 2.14.2
hunspell 1.7.0_2
icu4c 69.1
imagemagick 7.1.0-26
imath 3.1.4
isl 0.24
jasper 2.0.33
jbig2dec 0.19
jbig2enc 0.29
jemalloc 5.2.1_1
jena 4.4.0
jpeg 9e
jpeg-xl 0.6.1
lame 3.100
leptonica 1.82.0
libarchive 3.6.0
libass 0.15.2
libassuan 2.5.5
libb2 0.98.1
libbluray 1.3.0
libde265 1.0.8
libebml 1.4.2
libev 4.33
libevent 2.1.12
libffi 3.4.2
libgcrypt 1.10.0
libgpg-error 1.44
libheif 1.12.0_1
libidn 1.38
libidn2 2.3.2
libimagequant 4.0.0
libksba 1.6.0
liblqr 0.4.2_1
libmatroska 1.6.3
libmpc 1.2.1
libnghttp2 1.46.0
libogg 1.3.5
libomp 13.0.1
libpng 1.6.37
libproxy 0.4.17_1
libpthread-stubs 0.4
libraqm 0.9.0
librist 0.2.6_1
librsvg 2.52.6
libsamplerate 0.1.9_1
libsndfile 1.0.31
libsodium 1.0.18_1
libsoxr 0.1.3
libtasn1 4.18.0
libtiff 4.3.0
libtool 2.4.6_4
libunistring 1.0
libusb 1.0.25
libuv 1.43.0
libvidstab 1.1.0
libvmaf 2.3.0_1
libvorbis 1.3.7
libvpx 1.11.0
libx11 1.7.3.1
libxau 1.0.9
libxcb 1.14_2
libxdmcp 1.1.3
libxext 1.3.4
libxrender 0.9.10
libyaml 0.2.5
little-cms2 2.13.1
lz4 1.9.3
lzo 2.10
m4 1.4.19
maven 3.8.4
mbedtls 3.1.0
md4c 0.4.8
mkvtoolnix 65.0.0_1
mp4v2 2.0.0
mpdecimal 2.5.1
mpfr 4.1.0
nasm 2.15.05
netpbm 10.86.30
nettle 3.7.3
nghttp2 1.46.0
nlohmann-json 3.10.5
npth 1.6
nspr 4.33
nss 3.75
ocrmypdf 13.4.0
opencore-amr 0.1.5
openexr 3.1.4
openjdk 17.0.2
openjdk@11 11.0.12
openjpeg 2.4.0
openssl@1.1 1.1.1m
opus 1.3.1
p11-kit 0.24.1
pandoc 2.17.1.1
pango 1.50.4
parallel 20220222
pass 1.7.4
pcre 8.45
pcre2 10.39
pdftk-java 3.3.2
pillow 9.0.1
pinentry 1.2.0
pixman 0.40.0
pkg-config 0.29.2_3
pngcheck 3.0.3
pngquant 2.17.0
poppler 21.12.0
popt 1.18
pugixml 1.12.1
pybind11 2.9.0
python@3.10 3.10.2
python@3.8 3.8.12_1
python@3.9 3.9.10
qpdf 10.6.2
qrencode 4.1.1
qt 6.2.2
rav1e 0.5.1
rbenv 1.2.0
readline 8.1.2
rename 1.601
rsync 3.2.3
rubberband 2.0.2
ruby 3.1.1
ruby-build 20220218
rumble 1.17.0
s3cmd 2.2.0_1
saxon 10.6
sbt 1.6.2
sdl2 2.0.20
shared-mime-info 2.1
six 1.16.0_2
snappy 1.1.9
speex 1.2.0
sqlite 3.38.0
srt 1.4.4
tcl-tk 8.6.12_1
tesseract HEAD-5d5cd77
texinfo 6.8
theora 1.1.1
tika 2.3.0
tree 2.0.2
unbound 1.15.0
unpaper 6.1_8
utf8cpp 3.2.1
webp 1.2.2
wget 1.21.2
x264 r3060
x265 3.5
xcinfo 0.7.0
xmlto 0.0.28
xorgproto 2021.5
xvid 1.3.7
xxhash 0.8.1
xz 5.2.5
youtube-dl 2021.12.17
zeromq 4.3.4
zimg 3.0.3
zstd 1.5.2
% brew list --casks --versions
1password 7.6
adobe-acrobat-reader 20.012.20041
alfred 4.6.1,1274
amazon-chime 4.39.8497
atom 1.58.0
bbedit 14.0
bookends 14.0.4
boop 1.4.0
calibre 5.37.0
camo-studio 1.1.1,112
camtasia 2021.0.4
cheatsheet 1.6.1
cyberduck 8.2.3,36880
deepl 2.5.63019
discord 0.0.258
docker 4.4.2,73305
exist-db 6.0.1
firefox 79.0
github 2.5.3-f26bc4fa
google-chrome 84.0.4147.125
google-drive 51.0.9
gpg-suite 2020.1
istat-menus 6.40
jedit 5.6.0
joplin 2.6.10
kaleidoscope 3.1,2018
keycue 9.10
liberica-jdk8-full 1.8.0,322
libreoffice 
maccy 0.15.0
mattermost 5.0.4
microsoft-auto-update 4.27.20091302
microsoft-edge 95.0.1020.44
microsoft-office 16.40.20081000
microsoft-teams 1.3.00.18164
mimestream 0.31.5
ngrok 2.3.40
nova 1.1
obsidian 0.12.19
openrefine 3.5.2
openvpn-connect 3.3.3,4163
oxygen-xml-editor 24.0,2021121518
postman 7.30.1
proxyman 2.11.1
pycharm-ce 2021.3,213.5744.248
qtpass 1.3.2
signal 1.34.5
skype 8.64.0.80
slack 4.8.0
thunderbird 78.2.0
tower 5.1,245:560b4dd2
transmit 5.7.6
tropy 1.11.1
visual-studio-code 1.51.1
vlc 3.0.11.1
wkhtmltopdf 0.12.6-2
zoom 5.8.6.2879

@line-o
Copy link
Member Author

line-o commented Feb 24, 2022

Valuable feedback as always @joewiz

I do like the unversioned default + --version

@line-o
Copy link
Member Author

line-o commented Jul 20, 2022

Would it be handy to have this command as part of the node-exist package (not as a CLI)?

@line-o line-o added question and removed cli command line tool related issues labels Oct 26, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants