cmdLookup
- 5 Devlogs
- 8 Total hours
A command line tool to look up Linux commands to see their help info and what command is used to install it on all applicable package managers.
A command line tool to look up Linux commands to see their help info and what command is used to install it on all applicable package managers.
This project got denied so many times for bogus reasons, and now I’m forced to devlog to resubmit apparently. THEY TOLD ME I NEEDED SOURCE CODE IN MY REPO, WHEN I LITERALLY HAVE SOURCE CODE IN MY REPO. ITS THE FRICKIN BASH SCRIPT.
The API is now working fully, and aside from some accidental inconsistencies, the project is largely ready to ship!
I finished setting up my Cloudsmith repository. you can now the package by typing: (https://dl.cloudsmith.io/public/pixeleyesd/cmdlookup/setup.deb.sh)’ | sudo -E bash then type: sudo apt install cmdlookup. I also made the package name and the command name behave the same when inputted, and also made invalid values show up as “Invalid”
I have the status of whether the program is installed on the PC or not, as well as using the APIs listed before to add the description. I also locally fetch the install location if installed, and I output the help menu of the program if this is the case. Next step is to fetch the help menu or equivalent over an API.
I started work on my bash script that automatically finds the use of a given command, as well as where to download the package that uses the command.
First, I looked for and found a few APIs I wanted to use for this project. I settled on
https://command-not-found.com
and https://cheat.sh
for my main, and for the backup, in case command-not-found.com goes down, I went with https://packages.debian.org/search?keywords=.
Originally, when you put in, for example, firefox, the code was structured like as follows:
INSTALL_APT=“sudo apt install $COMMAND”
INSTALL_PACMAN=“sudo pacman -S $COMMAND”
INSTALL_DNF=“sudo dnf install $COMMAND”
INSTALL_ZYP=“sudo zypper install $COMMAND”
INSTALL_BREW=“brew install $COMMAND”
INSTALL_SNAP=“sudo snap install $COMMAND”
this basically meant that it would always tell you:
Installation Commands:
Debian/Ubuntu (APT): sudo apt install firefox
Arch Linux (Pacman): sudo pacman -S firefox
Fedora/RedHat (DNF): sudo dnf install firefox
openSUSE (Zypper): sudo zypper install firefox
macOS/Linux (Brew): brew install firefox
Universal (Snap): sudo snap install firefox
which is clearly NOT RIGHT
The solution was to use the APIs (as mentioned before) to look for the methods of installation. I’m now working on getting the local status of packages and displaying that, as well as using local information of the packages BEFORE using the APIs to fetch.