Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/jcsalterego/historian
Command-line utility for managing shell history in a SQLite database.
https://github.com/jcsalterego/historian
history shell
Last synced: 18 days ago
JSON representation
Command-line utility for managing shell history in a SQLite database.
- Host: GitHub
- URL: https://github.com/jcsalterego/historian
- Owner: jcsalterego
- License: other
- Created: 2017-04-10T21:59:27.000Z (over 7 years ago)
- Default Branch: main
- Last Pushed: 2024-02-11T23:37:24.000Z (10 months ago)
- Last Synced: 2024-06-11T19:16:37.027Z (6 months ago)
- Topics: history, shell
- Language: Shell
- Homepage:
- Size: 18.6 KB
- Stars: 547
- Watchers: 13
- Forks: 27
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
Awesome Lists containing this project
- awesome-repositories - jcsalterego/historian - Command-line utility for managing shell history in a SQLite database. (Shell)
README
historian
=========Command-line utility for managing shell history in a SQLite database.
`~/.bash_history` is deduped and imported into a database.
### Requirements
* SQLite
* a home directory### Installation
Download and 1) add the directory to your `$PATH`
export PATH="$PATH:/Users/jerry/historian"
or 2) add `hist` as an alias.
alias hist="/Users/jerry/historian/hist"
### Getting Started
Import your `~/.bash_history`
$ hist import
### Super Installation
Add `hist import` to your `.profile` (assuming `hist` is in your path):
$ echo hist import >> ~/.profile
This will import your .bash_history every time you launch a new shell.
### Usage
Show config:
$ hist config
version: 0.0.2
bash_history: /Users/jerry/.bash_history
db: /Users/jerry/.historian.db
sqlite3: /opt/local/bin/sqlite3Search:
$ hist search monsters
690
echo a zombie with no conscience >> ~/monsters
689
echo ghoul >> ~/monsters
688
echo goblin >> ~/monsters
687
echo lochness >> ~/monstersSearch (shorthand):
$ hist /monsters
690
echo a zombie with no conscience >> ~/monsters
689
echo ghoul >> ~/monsters
688
echo goblin >> ~/monsters
687
echo lochness >> ~/monstersView log:
$ hist log
1020
rm -f README.md
1019
emacs README.md
1018
rm -rf .git### Pitfalls
Live like your db file could be corrupted at any time.
Be wary of running specially crafted `hist` commands or against
`~/.bash_history` files.### Cool Things in the Future
* `export` to append to `~/.bash_history`
* `scrub` items from history
* set or autodetect configs
* other shells than bash
* timestamp support