~kris/dots

srice

ref: e5cf200ba29f0a659b2e92172f2fc940dc8d2017 srice/.local/share/man/man1/history.1 -rw-r--r-- 3.2 KiB
e5cf200b — Kris Yotam conky: Plan 9 modern theme with cyan border 4 months ago
                                                                                
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
.TH HISTORY 1 "January 2026" "history 1.0" "User Commands"
.SH NAME
history \- unified history viewer for terminal, clipboard, and browser searches
.SH SYNOPSIS
.B history
.B \-m
.I mode
.RI [ OPTIONS ]
.SH DESCRIPTION
.B history
is a unified history management system that tracks and queries:
.IP \(bu 2
Terminal commands (with exit codes and working directory)
.IP \(bu 2
Clipboard contents (with automatic deduplication)
.IP \(bu 2
Browser search queries (from Librewolf, Firefox, Brave, Chrome)
.PP
All entries are timestamped and stored in a SQLite database at
.IR ~/.local/share/history/history.db .
.SH MODES
The
.B \-m
flag is required and specifies which history to query:
.TP
.BR t ", " terminal
Terminal command history
.TP
.BR c ", " clipboard
Clipboard history
.TP
.BR s ", " search
Browser search history
.SH OPTIONS
.TP
.BI \-o " format"
Output format:
.BR t " (table),"
.BR j " (json),"
.BR p " (plain text, default)"
.TP
.BI \-n " count"
Number of entries to show (default: 100, use 0 for unlimited)
.TP
.BI \-d " date"
Filter by specific date in YYYY.MM.DD format
.TP
.BI \-q " query"
Search within entries (fuzzy match)
.TP
.BI \-b " browser"
Filter by browser name (search mode only). Valid values:
.BR librewolf ", " firefox ", " brave ", " chrome ", " chromium
.TP
.BI \-\-from " date"
Start date for range filter (YYYY.MM.DD)
.TP
.BI \-\-to " date"
End date for range filter (YYYY.MM.DD)
.TP
.B \-\-all
Show all entries (no limit, use with caution on large databases)
.TP
.B \-\-stats
Show statistics instead of entries
.TP
.BR \-h ", " \-\-help
Display help message
.SH EXAMPLES
.TP
Show last 100 terminal commands:
.B history \-m t
.TP
Show last 50 terminal commands in table format:
.B history \-m t \-n 50 \-o t
.TP
Search terminal history for git commands:
.B history \-m t \-q "git"
.TP
Show clipboard entries from a specific day:
.B history \-m c \-d 2026.01.23
.TP
Show Librewolf searches as JSON:
.B history \-m s \-b librewolf \-o j
.TP
Show searches from date range:
.B history \-m s \-\-from 2026.01.01 \-\-to 2026.01.15
.TP
Show terminal statistics:
.B history \-m t \-\-stats
.SH FILES
.TP
.I ~/.local/share/history/history.db
SQLite database containing all history
.TP
.I ~/.local/share/history/.last_sync
Timestamp of last browser sync
.TP
.I ~/.config/fish/conf.d/history.fish
Fish shell hooks for terminal logging
.TP
.I ~/.config/systemd/user/history-clipboard.service
Systemd service for clipboard daemon
.TP
.I ~/.config/systemd/user/history-browser-sync.timer
Systemd timer for browser sync (every minute)
.SH SETUP
Initialize the database:
.PP
.RS
.B history-init
.RE
.PP
Enable the clipboard daemon:
.PP
.RS
.B systemctl \-\-user enable \-\-now history-clipboard.service
.RE
.PP
Enable browser sync:
.PP
.RS
.B systemctl \-\-user enable \-\-now history-browser-sync.timer
.RE
.SH DATABASE SCHEMA
.SS terminal_history
.TS
l l.
id	INTEGER PRIMARY KEY
timestamp	DATETIME
command	TEXT
exit_code	INTEGER
pwd	TEXT
shell	TEXT
.TE
.SS clipboard_history
.TS
l l.
id	INTEGER PRIMARY KEY
timestamp	DATETIME
content	TEXT
content_type	TEXT
hash	TEXT UNIQUE
.TE
.SS search_history
.TS
l l.
id	INTEGER PRIMARY KEY
timestamp	DATETIME
query	TEXT
browser	TEXT
url	TEXT
hash	TEXT UNIQUE
.TE
.SH AUTHOR
Kris Yotam <krisyotam@protonmail.com>
.SH SEE ALSO
.BR sqlite3 (1),
.BR fish (1),
.BR xclip (1)