cliget/README.md

6.5 KiB

title date tags
manage command line tools in user profile 2023-02-01 linux, devtools, cli

Installs standalone command line utilities in your user profile

motivations

You have a variety of useful tools for day-to-day activities in the terminal, whether you're a developer or operations professional. These tools include jq, fzf, exa, and more. However, it's often difficult to determine if these tools are up to date, where they originate from, their exact functionality, and whether you still need them.

Some of these tools are included in your operating system's package manager, but they are often outdated. Additionally, you may prefer not to install them system-wide.

Cliget addresses these challenges by listing, installing, and updating standalone command line utilities in your user profile.

This solution was inspired by envinstall (undisclosed), webinstall, and asdf.

what

  • search catalog
    • identify latest version
  • download last release
    • from GH release
  • install for user
    • in various shapes:
      • from tar.gz
      • exe
      • wheel (python)
    • overriding info from the catalog (repo, version)
  • list installed
    • identify installed version
  • can install itself
  • have nice defaults (gh release, targz, x86_64, linux, etc.)
    • favor convention over configuration
    • tries to guess as much as possible
  • small codebase, preferably one file

won't

  • manage dependencies like apt or pip does
  • install system wide
  • install outside of dedicated folder
  • install from source, but could (rust/cargo, python/pip, go/go)
  • uninstall ; user can remove by her/him-self.
  • overlap with package managers (apt, yum, etc.) or environment managers (nix, asdf, etc.)

conventions and defaults

  • default status of an entry in the catalog is "ok" which means the process has been tested under linux-amd64
  • entry name in the catalog is the name of the exe ; a prefered name can be added as a property
  • packages are downloaded in ~/.cache/cliget
  • tools in unpacked in ~/.local/programs then symlinked in ~/.local/bin which must be in PATH
  • semver = semantic versioning : tools are versionned as major[.minor[.patch[-prerelease[+build]]]] so versions can be compared
  • installed version is obtained by ruinning <cli> --version
  • OS and arch are obtained with os.uname() python function
  • default release system is GitHub releases and use github property
  • default packaging is .tar.gz
  • default structure is to have the exe in the bin folder

most defaults can be overriden

FAQ

Q: What does it do, again ?

Cliget automates the following process:

  1. go to my useful tool website
  2. navigate to release section
  3. check if it has been updated
  4. if so, download, extract, install
  5. repeat for all the useful small tools I use
  6. repeat periodically

Cliget has nice defaults, favors convention over configuration, and does its best to "guess" how to get current version number, get last version number, download last release and install it properly.

Tools developers / maintainers are not supposed to know Cliget exists. It adapts to the way they deliver their software. Of course if they use GitHub release and TGZ, it's easier for Cliget to manage :')

Q: so I have to do this process for Cliget ?

Only the first time. After being installed, Cliget is managed by Cliget.

Q: why this name ?

It is like wget but fo CLI. Plus, I like the sound of it :)

Q: I already use asdf, why would I need cliget ?

asdf is a wonderful tool when it comes to do software development in various programming language while mixing versions from one project to an other.

But this power comes with some constraints : a plugin has to be developed in order to integrate a new tool to asdf ; And versions of every tool that will be used for a project has to be declared in a config file.

Cliget does not handle multi-versions and tools are deployed for your whole profile.

In short, if you want to manage development environment, use asfd. If you want to install small tools, use Cliget. They do not conflict, they complement each other.

Q: I already use the package manager of my OS to install tools, why would I need cliget ?

Package managers handle dependencies and install software system wide, for all users. Not all softwares are packaged for all OS distributions because this is hard work for maintainers. So you end up with some softwares not available or not up to date.

Cliget only install standalone programs, in the user profile (.local/bin). It does its best to find the last version and the best way to install the software. There is no need to package for Cliget.

Q: I already use Flatpack, AppImage, Snap to install tools in my profile, why would I need Cliget ?

These are package managers for the user profile. They come with heavy runtime. And, as classic package manager, not all tools are packaged nor up to date as it requires work from maintainers.

Cliget does not sandbox, nor manage dependencies but does not require any special packaging.

Q: I don't want to install python on my machine

Cliget is written in Python but packaged as a standalone program with no dependencies except libc and zlib, thanks to PyInstaller.

Q: I don't trust you. What prevent you from dumping me a malware instead of a genuine software ?

  • source code is available and very straightforward. you can audit the code, build from source or even write your own version
  • the tool will, by default, prompt you with clear information of what will be done before install
  • catalog is only one file, readable, with clear information on where the software is coming from and how it will be installed
  • also keep in mind you also have to trust the software dev team. We are different teams.

Q: I want this for macos or mswindows

Currently only Linux is supported. It should work on all Unix like OS. For others, contributions are welcome as long as they do not complicate the tool too much.

references

  • adfs
  • webinstall
  • has, check versions of commands
  • nvchecker, for checking if a new version of some software has been released.
  • fig/autocomplete, contributed completion for hundreds of CLI
  • thisarticle