Ariadne enables comprehensive CLI shell history logging, combined with interactive searching, using a modified version of Masafumi Oyamada's interactive grep tool: percol (https://github.com/mooz/percol). The CLI logging in bash/zsh
is modified from the following scripts:
- http://stackoverflow.com/questions/945288/saving-current-directory-to-bash-history
- https://gist.github.com/jeetsukumaran/2202879)
If you derive little joy from memorizing the arbitrary incantations and arcana of the unix command line this might be for you. With this you can:
- Reverse search through previous commands and the paths where they were run
- Extract either the path or command
- Filter by current path
- Filter out duplicate commands
- Filter by exit status 0
- Hide/show date, command, path fields in search output
- Stack commands and save to a script (rerun.sh)
- Filter by host etc
Ctrl+R
is captured to replace the default history search to pipe the log file (~/.<zsh/fish/bash>_log
) through the modified percol fuzzy finder. The log file records time, date, directory, host, exit status and command of every command entered. This makes it easy to retrieve commands in a new project directory based on a similar older project, find a deeply nested project dir by the command etc. I find I need this often when running scientific software in the unix world. Similarly Ctrl+Alt+R
is mapped to read a master log file, which can be used to record commands on multiple hosts if sym-linked to a file in a cloud sync directory.
Use the packaging approach to avoid being affected by the system’s Python virtual environment, say, pyenv. See here and here for the relevant discussions.
#https://stackoverflow.com/questions/63107313/is-there-an-alternative-to-pyinstaller-for-python-3-8
#https://pyoxidizer.readthedocs.io/en/stable/pyoxidizer_comparisons.html
# vx_Freeze
#https://github.com/pyinstaller/pyinstaller/discussions/6493#discussioncomment-1944421
$ pyenv shell datasci
# https://github.com/marcelotduarte/cx_Freeze
$ pip install --upgrade cx_Freeze --pre
# The generated executable is dist/perpol
$ cxfreeze -c bin/percol --packages curses,cmd --target-dir dist
# nuitka
# https://github.com/Nuitka/Nuitka/issues/1375#issuecomment-1010833442
# https://github.com/Nuitka/Nuitka/issues/1375#issuecomment-1010526356
#$ pip install -U nuitka
#$ nuitka3 --standalone --python-flag=no_site --static-libpython=no bin/percol
#If using on the same machine, the following is enough:
#$ nuitka3 --static-libpython=no bin/percol
# pyinstaller
#https://github.com/pyinstaller/pyinstaller/discussions/6493#discussioncomment-1946217
# The generated executable is dist/perpol/perpol
#$ pip uninstall percol
#$ pyinstaller --clean --noconfirm --collect-submodules percol --paths . bin/percol
$ git clone https://github.com/hongyi-zhao/ariadne
$ cd ariadne
TODO
Sourcing the following scripts in ~/.bashrc in turn:
TODO
See rc.py
for details.