historian

Command-line utility for managing shell history in a SQLite database.

  • 所有者: jcsalterego/historian
  • 平台:
  • 許可證: Other
  • 分類:
  • 主題:
  • 喜歡:
    0
      比較:

Github星跟蹤圖

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/sqlite3

Search:

$ hist search monsters
690
    echo a zombie with no conscience >> ~/monsters
689
    echo ghoul >> ~/monsters
688
    echo goblin >> ~/monsters
687
    echo lochness >> ~/monsters

Search (shorthand):

$ hist /monsters
690
    echo a zombie with no conscience >> ~/monsters
689
    echo ghoul >> ~/monsters
688
    echo goblin >> ~/monsters
687
    echo lochness >> ~/monsters

View 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

主要指標

概覽
名稱與所有者jcsalterego/historian
主編程語言Shell
編程語言Shell (語言數: 2)
平台
許可證Other
所有者活动
創建於2017-04-10 21:59:27
推送於2024-02-11 23:37:24
最后一次提交2021-03-10 14:23:17
發布數2
最新版本名稱0.0.2 (發布於 )
第一版名稱0.0.1 (發布於 )
用户参与
星數549
關注者數12
派生數27
提交數32
已啟用問題?
問題數15
打開的問題數0
拉請求數6
打開的拉請求數0
關閉的拉請求數4
项目设置
已啟用Wiki?
已存檔?
是復刻?
已鎖定?
是鏡像?
是私有?