Rich Enhanced Shell History - Contextual shell history for zsh and bash
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
Simon Let 039573e240 precess data in golang then analyze and plot in python 6 years ago
collect cosmetic changes 6 years ago
common precess data in golang then analyze and plot in python 6 years ago
daemon cosmetic changes 6 years ago
evaluate precess data in golang then analyze and plot in python 6 years ago
img update screenshot 7 years ago
sanitize-history add sanitized flag to record, add Enrich() to record 6 years ago
sanitizer_data add strategy-recent 6 years ago
submodules add bash-preexec as a submodule 7 years ago
.gitignore draft of prediction/recommendation evaluation 6 years ago
.gitmodules change submodule remote url to https 7 years ago
Gopkg.lock add Gopkg files to enable build on older systems 7 years ago
Gopkg.toml add Gopkg files to enable build on older systems 7 years ago
LICENSE Create LICENSE 7 years ago
Makefile precess data in golang then analyze and plot in python 6 years ago
README.md Update README.md 7 years ago
config.toml change port 7 years ago
go.mod checkpoint before separating plotting into python 6 years ago
go.sum checkpoint before separating plotting into python 6 years ago
install_helper.sh install minor change 7 years ago
rawinstall.sh Add readme and rawinstall 7 years ago
shellrc.sh minor changes to shell.rc 7 years ago
uuid.sh add workaround to get uuid on macOS 7 years ago
version precess data in golang then analyze and plot in python 6 years ago

README.md

Rich Enhanced Shell History

What

This project is the first phase of my Master project.

It records shell history with rich set of metadata and saves it locally. (device, dir, git, ... see example below)

It doesn't change the way your shell and your shell history behaves.

You won't notice any delay in your shell (~40ms).

If you are not happy with it you can uninstall it with a single command (rm -rf ~/.resh).

Why

The ultimate point of my thesis is to provide a context-based replacement/enhancement for bash and zsh shell history.

The idea is to:

  • Save each command with metadata (device, dir, gitdir, ...)
  • Recommend history based on saved metadata (e.g. it will be easier to get to commands specific to your project)
  • Provide a simple way to search whole history by command itself and/or metadata (e.g. imagine searching by project, directory, device, ...)
  • Synchronize history across devices
  • Provide an API (to make the project easily extensible)
  • And more ...

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

That's why I ask YOU to install this tool to locally record your shell history.

After some time (probably a few months) I will create a script to replace anything too personal in the recorded data by placeholders.

Then I will ask you to run the script against the recorded data and tell me if you are willing to share the resluts with me.

I'm very thankful for anyone who is willing to support my thesis by providing their usage data!

If you install RESH, please give me some contact info using this form: https://forms.gle/227SoyJ5c2iteKt98

Prereqisities

  • git
  • golang (>1.11 if possible but we can deal with old ones as well)

Installation

Simplest

Just run bash -c "$(wget -O - https://raw.githubusercontent.com/curusarn/resh/master/rawinstall.sh)" from anywhere.

Simple

  1. Run git clone https://github.com/curusarn/resh.git && cd resh
  2. Run make autoinstall for assisted build & instalation.
    • OR Run make install if you know how to build Golang projects.

If you install RESH, please give me some contact info using this form: https://forms.gle/227SoyJ5c2iteKt98

Compatibility

Works in bash and zsh.

Tested on:

  • Arch
  • MacOS
  • Ubuntu (18.04)
  • really old Ubuntu (16.04)

Examples

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

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

You are welcome to create issues: 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.