Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/AnirudhG07/cheatshh
Cheatshh is a CLI tool to store commands and their descriptions in a place you can look into as cheatshheat so you dont have to remember them.
https://github.com/AnirudhG07/cheatshh
Last synced: about 2 months ago
JSON representation
Cheatshh is a CLI tool to store commands and their descriptions in a place you can look into as cheatshheat so you dont have to remember them.
- Host: GitHub
- URL: https://github.com/AnirudhG07/cheatshh
- Owner: AnirudhG07
- License: apache-2.0
- Created: 2024-05-04T06:45:11.000Z (8 months ago)
- Default Branch: main
- Last Pushed: 2024-05-22T09:41:13.000Z (7 months ago)
- Last Synced: 2024-05-22T10:49:46.099Z (7 months ago)
- Language: Shell
- Size: 26.6 MB
- Stars: 3
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
- awesome-tuis - cheatshh - line cheatsheet for Unix. (Table of Contents)
README
# cheatshh ![Static Badge](https://img.shields.io/badge/version-1.1.1-blue)
Cheatshh is an interactive CLI meant for managing command line cheatsheets, written in shell script. Now you don't have to remember CLI commands and just refer your cheatsheet. You can group commands and view their TLDR(or anyother) and MAN pages along with a custom description for the command.
> **Note:** This software is tested on and initially configured for MacOS. Please check out the [configuration documentation] to set it up for your system.
## Table of Contents
* [Preview/Screenshots ](#previewscreenshots-)
* [Features](#features)
* [Installation](#installation)
* [Pip Installation](#pip-installation)
* [Homebrew Installation](#homebrew-installation)
* [Manual Installation through git clone](#manual-installation-through-git-clone)
* [For MacOS and Linux](#for-macos-and-linux)
* [For Windows](#for-windows)
* [Libraries and Groups](#libraries-and-groups)
* [Bookmarking](#bookmarking)
* [Dependencies](#dependencies)
* [Cheatshh Configuration](#cheatshh-configuration)
* [Saving cheatshh](#saving-cheatshh)
* [Trouble-shooting](#trouble-shooting)
* [Documentation](#documentation)
* [Check it out](#check-it-out)
* [Contributing](#contributing)
* [Contribution Guidelines](#contribution-guidelines)# Preview/Screenshots
https://github.com/AnirudhG07/cheatshh/assets/146579014/d064f201-2b2f-46b3-a341-7b913646e4ef
# Features
- Comprehensive cheatsheets for various command-line utilities and tools.
- Easy-to-use interface for quickly accessing and executing commands, powered by fuzzy finder(fzf) and whiptail.
- Customizable cheatsheets and groups to suit your needs.
- TLDR(any more) and MAN pages visible in the preview.
- Easy to add, edit, delete commands & groups and play around.
- Bookmark commands to access them outside of group as well.
- Change configurations like colors, automatic man page display, usages of other cheatsheets like tldr, cheats.sh, etc.# Installation
The following installation guidelines hold for Linux and MacOS.
You can download cheatshh through following ways- (more will be added soon)## Pip Installation
Before running the below commands, make sure your dependencies are satisfied. See the DEPENDENCIES section for more info.
From your command line, run-```bash
pip install cheatshh
```This will create ~/.config/cheatshh in your home directory. Now simply run-
```bash
cheatshh
```and you are done. Use various options to add, edit and delete commands and groups.
## Homebrew Installation
This tool can also be installed using Homebrew(for MacOS only). You can install it by tapping my homebrew-tap repo and installing the tool.
```bash
brew install AnirudhG07/AnirudhG07/cheatshh
```You can now run the tool by running `cheatshh -h` in your terminal. If you are facing issues, try running-
```bash
brew tap AnirudhG07/AnirudhG07
brew install cheatshh
```Make sure you have Homebrew installed in your MacOS and it is updated which can be done by running `brew update`.
## Manual Installation through git clone
You can setup manual installation with the following guidelines-
### For MacOS and Linux
1. Clone the repository
```bash
git clone https://github.com/AnirudhG07/cheatshh
```2. Navigate to the project directory run below if downloaded in home directory
```bash
cd ~/cheatshh
```3. Install the requirements through
```
pip install -r requirements.txt
```4. (optional) Make sure you have `poetry` installed which will be required to build the project. If not you can run either of the below commands-
```bash
pip install poetry
# OR
curl -sSL https://install.python-poetry.org | python -
```
This will download `peotry`. Now you can proceed to the next step.5. Run the below code to set cheatshh
```bash
pip install .
```Now you should be able to use the tool by running `cheatshh` in your terminal. Feel free to raise an issue if any error comes up.
## For Windows
For Windows, you can use Virtual Machines of Linux, or change configurations manually.
> From version >= 1.1.1, the configurations for having `cheatshh` on Windows has greatly been improved.- Change the path to directory `~/.config/cheatshh` to `absolute/path/to/your/directory/cheatshh`, by using grep command in the cheatshh directory, in `cheatshh.toml` and `cheats.sh` only at the one place.
- This should run cheatshh appropriately. Make sure the dependencies are installed, since they are easily available for Unix applications.
# Libraries and Groups
You can create custom groups using-
```bash
cheatshh -g
```We also have premade libraries of groups here which you can download with the instructions given there itself.
We welcome you to publish your own libraries for everyone to see.# Bookmarking
Bookmarking let's you save your command in the main preview despite them being present in a group.
You can bookmark a command by pressing Enter and selecting `Bookmark`. Now you don't need to find it in a group and access it in the main preview.
You can always remove Bookmark of a command by pressing Enter and selecting `Remove Bookmark`.# Dependencies
Cheatshh uses the following as its main tools. Ensure that these are pre-installed in your computer.
- fuzzy finder(fzf)
- whiptail
- jq
- yq
**NOTE:** jq and yq used in the package is the version present in Homebrew. Thus please install that instead of from Pypi.(It didn't work for me.)In MacOS, you can use HomeBrew to install the above packages with-
```bash
brew install
```For MacOS & Linux both, you can run the following command to download the packages.
```bash
sudo apt install
```For Windows, you can use your favourite package manager or download from their website itself.
# Cheatshh Configuration
You can change various configurations of cheatshh like colors, automatic man page display, usages of other cheatsheets like tldr, cheats.sh, etc. You can do this by going to the `cheatshh/cheatshh.toml` file and changing the values as per your needs.
**NOTE:** All the instructions on how to change suitably is mentioned within the file itself. If you are facing any issues, feel free to raise an issue.# Saving cheatshh
When you have configured your cheatshh, you would definitely want to save them. If you want to use cheatshh in some different machine without rewriting again(cause that's a lot of trouble). Here's how you can save it.
1. Make a repository by the name `Your_handle/cheatshh` or any other name. You can also add it to your repo where you are storing your dot files.
2. You can use `stow` command to configure everything in an instant. Here's the layout of the directory if you will use stow-
```markdown
cheatshh
└─── .config
└── cheatshh
├── cheats.sh
├── commands.json
├── groups.json
└── any/other/file
```Now you can simply download this directory, run `stow cheatshh`, this will setup your cheatshh in the `.config/cheatshh` as it should be.
OR you can manually set it up, in that case you don't need the above tree, you can simply use have the last level of tree inside cheatshh directory.Don't forget to make `setup.sh` executable.
# Trouble-shooting
1. If you are facing issues with `jq` and `yq`, please try the following first -
- Add ABSOLUTE PATH of your `.config/cheatshh` in the `cheatshh.toml` and `cheats.sh` file as pointed [for Windows](#for-windows)
- The jq and yq used in the packages is from Homebrew and Pypi yq would not work. So make sure you have that `jq` and `yq` installed.2. If permission denial error shows up, run the same command using sudo. You will have to provide password in this case.
```bash
sudo
```This might be needed in the case for man page display or maybe for installation of dependency.
3. If `WARNING: The script cheatshh is installed in '/home/admin/.local/bin' which is not on PATH.` error comes, then cheatshh script has to be included in the system PATH, you can add the following lines to the appropriate shell configuration.
- BASH: Add the following at the end of ~/.bashrc
```bash
export PATH="$HOME/.local/bin:$PATH"
```- ZSH: Add the following at the end of ~/.zshrc
```bash
export PATH="$HOME/.local/bin:$PATH"
```After adding these lines, either restart your terminal or run source on the respective configuration file to apply the changes. For example:
```bash
source ~/.bashrc # For Bash
source ~/.zshrc # For Zsh
```This should add the path in your `shell-rc` file and you should be able to run.
Note: If you are using some other shell like fish or any similar other, configure the settings accordingly. Using Fish is not recommended for this tool.
# DocumentationCheatshh is an interactive, easy CLI tool to maintain your custom cheatsheets. You can check our the docs to see how to use cheatshh.
# Check it out
Check out my Yazi File manager plugin for cheatshh at [cheatshh.yazi](https://github.com/AnirudhG070/plugins-yazi/tree/main/cheatshh.yazi). You can save your yazi shell commands and easily access them within Yazi.# Contributing
I would love to take contributions from the community! If you have suggestions for new cheatsheets, improvements to existing ones, or bug fixes, please feel free to submit a pull request.
### Contribution Guidelines
1) For contribution of a library, it should have a suitable folder name(max 3 words) with commands.json and groups.json, similar to the format in other libraries. The `group` field should be "yes", `bookmark` field should be "no".
2) For bug fixes, it will be great if you could discuss first in Issues before directly putting a PR.
3) It would be great to publish this in other package managers. So I would request help for publishing to different package managers.