Welcome, guest | Sign In | My Account | Store | Cart

Notice! PyPM is being replaced with the ActiveState Platform, which enhances PyPM’s build and deploy capabilities. Create your free Platform account to download ActivePython or customize Python with the packages you require and get automatic updates.

pypm install rash

How to install rash

  1. Download and install ActivePython
  2. Open Command Prompt
  3. Type pypm install rash
 Python 2.7Python 3.2Python 3.3
Windows (32-bit)
0.1a.dev Available View build log
0.1dev Available View build log
Windows (64-bit)
0.1a.dev Available View build log
0.1dev Available View build log
Mac OS X (10.5+)
0.1a.dev Available View build log
0.1dev Available View build log
Linux (32-bit)
0.1a.dev Available View build log
0.1dev Available View build log
Linux (64-bit)
0.1a.dev Available View build log
0.1dev Available View build log
GNU General Public License v3 (GPLv3)
Lastest release
version 0.1.2 on Sep 20th, 2013

What is this?

Shell history is useful. But it can be more useful if it logs more data points. For example, if you forget which make target to run for certain project, you'd want to search shell commands that are run in particular directory. Wouldn't it be nice if you can do this?:

rash search --cwd . "make*"

RASH records many data points and they are stored in SQLite database. Here is a list of recorded information [1].

  1. Current directory ($PWD).
  2. Exit code ($?)
  3. Exit code of pipes ($PIPESTATUS / $pipestatus)
  4. The time command is started and terminated.
  5. Environment variable ($PATH, $SHELL, $TERM, $HOST, etc.)
  6. Real terminal. $TERM is used to fake programs. RASH can detect if you are in tmux, byobu, screen, gnome-terminal, etc.
  7. Session information. If you go back and forth in some terminals, RASH does not loose in which sequence you ran the commands in which terminal.
[1]If you are curious, checkout rash record --help.

RASH also has interactive search interface. You can see the search result as you type. If you are using zsh, you can execute the result instantaneously.

RASH interactive search interface


RASH is written in Python. The easiest way to install is to use pip (or easy_install, if you wish). You may need sudo for installing it in a system directory.:

pip install rash
pip install percol  # if you want interactive search feature

If you use virtualenv to install RASH, you may have trouble when switching environment. In that case, it is safe to make an alias to full path of the rash executable.:

alias rash="PATH/TO/VIRTUALENV/bin/rash"

If you want to use developmental version, just clone the git repository and add the following in your RC file.:

alias rash="PATH/TO/RASH/rash_cli.py"


Add this to your .zshrc or .bashrc. That's all.:

eval "$(rash init)"

For more information, see rash init --help.


Showing detailed information -- rash show

If you give --with-command-id to rash search command, it prints out ID number for each command history.:

% rash search --with-command-id --limit 5 "*git*"
 359  git log
1253  git help clone
1677  git help diff
1678  git diff --word-diff
1780  git merge

You can see all information associated with a command with rash show command:

rash show 1677
Interactive search -- rash isearch

Searching history using command line is not fast. You can use rash isearch command to interactively search history and see the result immediately as you type.

You need percol to use this feature.

Zsh user can setup a keybind like this:

# Type `Ctrl-x r` to start isearch
bindkey "^Xr" rash-zle-isearch

Defining this function in your rc file can be handy and it is usable for bash users.:

  eval "$(rash isearch)"


RASH tested against Python 2.6, 2.7 and 3.2. However, as some dependencies are not Python 3 compatible, some functionality is missing when used with Python 3.

Python modules:

[2](1, 2) These modules do not support Python 3. They are not installed in if you use Python 3 and related functionality is disabled.
UNIX-like systems
RASH is tested in Linux and I am using in Linux. It should work in other UNIX-like systems like BSD.
Mac OS
I guess it works. Not tested.
MS Windows
Probably no one wants to use a shell tool in windows, but I try to avoid stuff that is platform specific. Only the daemon launcher will not work on Windows but there is several ways to avoid using it. See rash init --help.

RASH currently supports zsh and bash.

Design principle

RASH's design is focused on sparseness. There are several stages of data transformation until you see the search result, and they are done by separated processes.

First, rash record command dumps shell history in raw JSON record. This part of program does not touches to DB to make process very fast. As there is no complex transformation in this command, probably in the future version it is better to rewrite it entirely in shell function.

Second, rash daemon runs in background and watches the directory to store JSON record. When JSON record arrives, it insert the data into database.

rash record and rash daemon are setup by simple shell snippet eval $(rash init).

Finally, you can search through command history using search interface such as rash search. This search is very fast as you don't read all JSON records in separated files.

+-------+         +--------+         +--------+         +--------+
| Shell |         | Raw    |         | SQLite |         | Search |
| hooks |-------->| JSON   |-------->|   DB   |-------->| result |
+-------+         | record |         +--------+         +--------+

        `rash record`      `rash daemon`      `rash search`
                                               `rash show`

        \------------------------------/      \------------/
           `rash init` setups them           search interface


RASH is licensed under GPL v3. See COPYING for details.

Subscribe to package updates

Last updated Sep 20th, 2013

What does the lock icon mean?

Builds marked with a lock icon are only available via PyPM to users with a current ActivePython Business Edition subscription.

Need custom builds or support?

ActivePython Enterprise Edition guarantees priority access to technical support, indemnification, expert consulting and quality-assured language builds.

Plan on re-distributing ActivePython?

Get re-distribution rights and eliminate legal risks with ActivePython OEM Edition.