Terminal session logger with full-text search
Project description
keeplog
Terminal session logger with full-text search.
Records every command + output in your terminal, saves to SQLite, and lets you search instantly.
pip install keeplog
keeplog setup # auto-start on every terminal
# restart your terminal — it's already recording
Features
- PTY capture — records full output, not just commands
- SQLite + FTS5 — instant full-text search across everything
- fzf integration — interactive fuzzy search with preview
- Zero config — install and forget, always running in background
- Two modes — full (capture output) or light (metadata only)
- Lightweight — no servers, no cloud, no dependencies
- Cross-platform — macOS + Linux, zsh + bash
Install
pip install keeplog
Or one-liner (installs pip package + sets up auto-start):
curl -fsSL https://raw.githubusercontent.com/rathinadev/keeplog/main/install.sh | sh
Quick Start
# Initialize database
keeplog init
# Start recording manually
keeplog record
# (type commands, then exit)
# Set up auto-start (adds to .zshrc/.bashrc)
keeplog setup
# Restart your terminal — recording starts automatically
# Search recorded commands
keeplog search docker
keeplog search "npm install"
# Browse recent
keeplog recent
keeplog get 1 # show full output of command #1
# Stats
keeplog status
Commands
| Command | Description |
|---|---|
record |
Start recording session |
setup |
Add auto-start hook to shell rc |
remove |
Remove auto-start hook |
search <query> |
Interactive search (fzf if available) |
recent |
Show recent commands |
get <id> |
Show full command details + output |
status |
Show stats |
last |
Show last session |
export |
Export all data as JSON |
clear <days> |
Clear data older than N days |
config [key val] |
Get/set configuration |
init |
Initialize database |
Configuration
# Set mode to light (metadata only, no output)
keeplog config mode light
# Set retention to 7 days
keeplog config retention_days 7
# View current config
keeplog config
Config file location:
- macOS:
~/Library/Application Support/keeplog/config.json - Linux:
~/.config/keeplog/config.json
How It Works
keeplog recordspawns your shell inside a pseudo-terminal (PTY)- Every keystroke and output streams through keeplog
- Shell hooks (preexec/precmd) mark command boundaries
- Output is stripped of ANSI escape codes and saved to SQLite with FTS5
keeplog searchqueries the FTS index and pipes results into fzf
Terminal → keeplog record → PTY → your shell
↓
SQLite DB → fzf search
Storage
Data is stored locally — no cloud, no servers:
- macOS:
~/Library/Application Support/keeplog/logs.db - Linux:
~/.local/share/keeplog/logs.db
Uninstall
pip uninstall keeplog
keeplog remove
Development
git clone https://github.com/rathinadev/keeplog
cd keeplog
pip install -e .
python -m pytest tests/
License
MIT
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file keeplog-0.1.1.tar.gz.
File metadata
- Download URL: keeplog-0.1.1.tar.gz
- Upload date:
- Size: 11.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.11.15
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
bf72fb886a52773afa72870ecd6bc2e8d9ccea7a95289ddc0def3fa8fd46df6f
|
|
| MD5 |
cac302e95be59c6c506dfbcc6cc607b0
|
|
| BLAKE2b-256 |
6a1a9458cee382f5f1fd84cc9f8c519b376c1495e299a76d63d25d12410df74a
|
File details
Details for the file keeplog-0.1.1-py3-none-any.whl.
File metadata
- Download URL: keeplog-0.1.1-py3-none-any.whl
- Upload date:
- Size: 12.5 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.11.15
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
986686b692d909b7e433b318ec43ca7e2a255d8749ec262b84e72655c5ffe292
|
|
| MD5 |
a044925aa280fc44ac26e7e5cdefeca0
|
|
| BLAKE2b-256 |
081d18708d9783ca9bea7225682949e5dfb918b3280a24c249e377354927008d
|