https://github.com/lennardv2/ehh
Commandline tool for remembering linux/terminal commands
https://github.com/lennardv2/ehh
bash linux osx remember terminal utility
Last synced: 7 months ago
JSON representation
Commandline tool for remembering linux/terminal commands
- Host: GitHub
- URL: https://github.com/lennardv2/ehh
- Owner: lennardv2
- License: mit
- Created: 2021-01-11T13:12:56.000Z (almost 5 years ago)
- Default Branch: main
- Last Pushed: 2022-08-22T08:03:38.000Z (over 3 years ago)
- Last Synced: 2025-04-08T07:38:58.134Z (8 months ago)
- Topics: bash, linux, osx, remember, terminal, utility
- Language: Python
- Homepage:
- Size: 49.8 KB
- Stars: 80
- Watchers: 6
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
- awesome-cli-apps-in-a-csv - ehh - Command-line tool for remembering Linux/terminal commands. (<a name="cheatsheet"></a>Commands cheatsheet and snippets)
- awesome-cli-apps - ehh - Command-line tool for remembering Linux/terminal commands. (<a name="cheatsheet"></a>Commands cheatsheet and snippets)
README
# ehh

## Remember linux commands
Tired of forgetting bash/linux/osx commands?
Store and run any command inside ```ehh```.
```pipx install ehh ```
## Why not just alias or ctrl+r?
Well, ehh provides:
* An organized list of aliases
* List groups
* List filtering
* Support for vars, which are prompted on run
* Easy way to add an alias
## Features
https://user-images.githubusercontent.com/168357/185811288-a5767eb8-3da9-46eb-a9a7-5b45fab97513.mp4
* Store commands like ``sudo lsof -iTCP -sTCP:LISTEN -n -P`` (osx) under an alias like ``sys.ports``
* Add a description to your command ``Check Listening Ports``
* Run the command by alias ``ehh sys.ports`` or by index ``ehh 23``
* Show a list of all stored commands by typing ``ehh``
* Filter the list of stored commands by typing ``ehh {query}``. ``ehh sys`` will show all commands in the sys namespace.
https://user-images.githubusercontent.com/168357/185811458-d383212a-dc37-4f46-9abe-bcf708509496.mp4
* Add vars to a commmand by using ``(:var_name)``. For example: ``find "$(pwd)" -name (:search) 2>/dev/null`` will prompt for a search query to search in the current directory (osx)
* All commands are stored inside ``~/ehh.yaml``
* See ``ehh help`` for more info
# Installation
## Via [pipx](https://pypa.github.io/pipx/)
```
pipx install ehh
```
## Manual installation
```
curl https://raw.githubusercontent.com/lvoogdt/ehh/main/ehh/cli.py -o ehh.py && chmod +x ehh.py
```
Add it to your path:
```
sudo ln -s $(pwd)/ehh.py /usr/local/bin/ehh
```
Install python libs:
```
pip install colorama click pyyaml
```
If you want to start with some commands you can use the example ehh.yaml. The commands in this file are linux based.
```
curl https://raw.githubusercontent.com/lvoogdt/ehh/main/ehh/ehh.yaml -o ehh.yaml && mv ehh.yaml ~/ehh.yaml
```
# Examples
```
$ ehh add
> Command: sudo usermod -a -G (:group) (:user)
> Description: Add a user to a group
> Group (optional):
> Alias (optional): user.group
$ ehh # Get a list
> 1 sudo usermod -a -G (:group) (:user) user.group Add a user to a group
$ ehh 1
> user: john
> group: docker
(Command sudo usermod -a -G docker john is ran)
$ ehh user.group # Using the lias
> user: john
> group: docker
(Command sudo usermod -a -G docker john is ran)
```
# Docs
```
$ ehh add
```
Enter the command you want to store, a description and an optional group.
```
$ ehh ls QUERY?
```
List your commands with an index and description. Add an optional QUERY to filter the list.
```
$ ehh run INDEX|ALIAS
OR
$ ehh INDEX (less typing)
OR
$ ehh ALIAS
if ehh INDEX|ALIAS fails, it return the list filtered by query
```
Run your command by index. It's also possible to use an alias, it will loop through the matches and ask for it to be run.
```
$ ehh get INDEX
```
Get all the details of the command
```
$ ehh rm INDEX
```
Remove command by index
[](https://hits.seeyoufarm.com)