All Projects → curusarn → Resh

curusarn / Resh

Licence: mit
Rich Enhanced Shell History - Contextual shell history for zsh and bash

Programming Languages

go
31211 projects - #10 most used programming language
bash
514 projects

Projects that are alternatives of or similar to Resh

Dotfiles
Zsh, Karabiner, VS Code, Sublime, Neovim, Nix
Stars: ✭ 634 (+104.52%)
Mutual labels:  productivity, zsh
Notes
📝 Simple delightful note taking, with more unix and less lock-in.
Stars: ✭ 939 (+202.9%)
Mutual labels:  productivity, zsh
Zsh Iterm Touchbar
Display feedback of terminal in the 🍏 Touchbar
Stars: ✭ 632 (+103.87%)
Mutual labels:  productivity, zsh
Thirsty
Reminds you to drink water - on your terminal.
Stars: ✭ 296 (-4.52%)
Mutual labels:  productivity, zsh
cdc
☣️ Shell plugin for zsh/bash that allows you to cd to subdirectories of user-defined directories from anywhere, without editing CDPATH.
Stars: ✭ 17 (-94.52%)
Mutual labels:  zsh, productivity
Dtags
Directory Tags for Lazy Programmers
Stars: ✭ 351 (+13.23%)
Mutual labels:  productivity, zsh
Goto
Alias and navigate to directories with tab completion in Linux
Stars: ✭ 698 (+125.16%)
Mutual labels:  productivity, zsh
Bashhub Client
☁️ Bash history in the cloud. Indexed and searchable.
Stars: ✭ 858 (+176.77%)
Mutual labels:  zsh, history
hstdb
Better history management for zsh. Based on ideas from https://github.com/larkery/zsh-histdb.
Stars: ✭ 25 (-91.94%)
Mutual labels:  zsh, history
timber-ruby
🌲 Great Ruby logging made easy.
Stars: ✭ 155 (-50%)
Mutual labels:  metadata, context
Hstr
bash and zsh shell history suggest box - easily view, navigate, search and manage your command history.
Stars: ✭ 2,909 (+838.39%)
Mutual labels:  zsh, history
Composure
Don't fear the Unix chainsaw
Stars: ✭ 272 (-12.26%)
Mutual labels:  zsh, metadata
Bashhub Server
Private cloud shell history. Open source server for bashhub https://github.com/rcaloras/bashhub-client
Stars: ✭ 189 (-39.03%)
Mutual labels:  zsh, history
Wd
🚀 Jump to custom directories in zsh
Stars: ✭ 555 (+79.03%)
Mutual labels:  productivity, zsh
Hstr Rs
hstr, but with paging
Stars: ✭ 122 (-60.65%)
Mutual labels:  zsh, history
Zsh You Should Use
📎 ZSH plugin that reminds you to use existing aliases for commands you just typed
Stars: ✭ 659 (+112.58%)
Mutual labels:  productivity, zsh
Zsh Histdb
A slightly better history for zsh
Stars: ✭ 801 (+158.39%)
Mutual labels:  zsh, history
Zsh History To Fish
Bring your ZSH history to Fish shell.
Stars: ✭ 23 (-92.58%)
Mutual labels:  zsh, history
Ohmyzsh
🙃 A delightful community-driven (with 1900+ contributors) framework for managing your zsh configuration. Includes 300+ optional plugins (rails, git, macOS, hub, docker, homebrew, node, php, python, etc), 140+ themes to spice up your morning, and an auto-update tool so that makes it easy to keep up with the latest updates from the community.
Stars: ✭ 138,057 (+44434.52%)
Mutual labels:  productivity, zsh
atuin
🐢 Magical shell history
Stars: ✭ 1,295 (+317.74%)
Mutual labels:  zsh, history

GitHub tag (latest SemVer)

Rich Enhanced Shell History

Context-based replacement/enhancement for zsh and bash shell history

Search your history by commands and get relevant results based on current directory, git repo, exit status, and host.

Installation

Prerequisites

Standard stuff: bash(4.3+), curl, tar, ...

Bash completions will only work if you have bash-completion installed

MacOS: coreutils (brew install coreutils)

Simplest installation

Run this command.

curl -fsSL https://raw.githubusercontent.com/curusarn/resh/master/scripts/rawinstall.sh | bash

Simple installation

  1. Run git clone https://github.com/curusarn/resh.git && cd resh
  2. Run scripts/rawinstall.sh

Update

Check for updates and update

reshctl update

Roadmap

Overview of the features of the project

RESH SEARCH application

This is the most important part of this project.

RESH SEARCH app searches your history by commands. It uses host, directories, git remote, and exit status to show you relevant results first.

All this context is not in the regular shell history. RESH records shell history with context to use it when searching.

At first, the search application will look something like this. Some history with context and most of it without. As you can see, you can still search the history just fine.

resh search app

Eventually most of your history will have context and RESH SEARCH app will get more useful.

resh search app

Without a query, RESH SEARCH app shows you the latest history based on the current context (host, directory, git).

resh search app

RESH SEARCH app replaces the standard reverse search - launch it using Ctrl+R.

Enable/disable the Ctrl+R keybinding:

reshctl enable ctrl_r_binding
reshctl disable ctrl_r_binding

In-app key bindings

  • Type to search/filter
  • Up/Down or Ctrl+P/Ctrl+N to select results
  • Right to paste selected command onto the command line so you can edit it before execution
  • Enter to execute
  • Ctrl+C/Ctrl+D to quit
  • Ctrl+G to abort and paste the current query onto the command line
  • Ctrl+R to switch between RAW and NORMAL mode

View the recorded history

Resh history is saved to ~/.resh_history.json

Each line is a JSON that represents one executed command line.

This is how I view it tail -f ~/.resh_history.json | jq or jq < ~/.resh_history.json.

You can install jq using your favourite package manager or you can use other JSON parser to view the history.

screenshot

Recorded metadata will be reduced to only include useful information in the future.

Data sanitization and analysis

In order to be able to develop a good history tool I will need to get some insight into real life shell and shell history usage patterns.

Running reshctl sanitize creates a sanitized version of recorded history.
In sanitized history, all sensitive information is replaced with its SHA256 hashes.

If you tried sanitizing your history and you think the result is not sanitized enough then please create an issue or message me.

If you would consider supporting my research/thesis by sending me a sanitized version of your history then please give me some contact info using this form: https://forms.gle/227SoyJ5c2iteKt98

Known issues

Q: I use bash on macOS and resh doesn't work

A: You have to add [ -f ~/.bashrc ] && . ~/.bashrc to your ~/.bash_profile.

Long Answer: Under macOS bash shell only loads ~/.bash_profile because every shell runs as login shell. I will definitely work around this in the future but since this doesn't affect many people I decided to not solve this issue at the moment.

Issues and ideas

Please do create issues if you encounter any problems or if you have a suggestions: https://github.com/curusarn/resh/issues

Uninstallation

You can uninstall this project at any time by running rm -rf ~/.resh/.

You won't lose any recorded history by removing ~/.resh directory because history is saved in ~/.resh_history.json.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].