Local-first semantic search for your shell history. Search by intent, not exact text. No cloud, no API keys.
Project description
whatwasit
Local-first semantic search for your shell history.
Search by what you were trying to do, not the exact command you typed — and nothing ever leaves your machine.
whatwasit "how did I fix that nginx issue"
Returns the session of commands you actually ran (cd, vim, systemctl reload nginx) weeks ago, even though you never typed "fix" or "issue".
Features
- Intent-based recall — searches whole command sessions, not isolated lines
- Session grouping — reconstructs working directory and groups commands by time
- Hybrid reranking — boosts exact tool-name and flag matches when your query contains them, without hurting natural-language queries
- Fully offline — ONNX embedding model on CPU; no cloud, no API keys
- Non-destructive — reads your existing history files; never modifies them
Install
pip install whatwasit
Upgrade an existing install:
pip install -U whatwasit
Requirements: Python 3.9+ and ~100 MB disk for the embedding model (downloaded once on first run).
Quick start
# Build the search index from your shell history
whatwasit index
# Interactive REPL (default when run with no arguments)
whatwasit
# One-shot search
whatwasit "that time I set up passwordless ssh"
Usage
# Refresh the index after new history accumulates
whatwasit index
# Force a full rebuild
whatwasit index --rebuild
# Adjust session grouping window (default: 300 seconds)
whatwasit index --window 600
# Plain output for scripts and piping
whatwasit "docker volume that wouldn't persist" --plain
# Return more results
whatwasit "nginx config" -k 20
# Keep the embedder warm for faster repeated queries (optional)
whatwasit daemon start
whatwasit daemon status
whatwasit daemon stop
TUI / REPL
Running whatwasit with no arguments opens a persistent REPL with a bottom input
bar. Type a natural-language query and press Enter to search; results update in
place with matched commands highlighted. Directory and timestamp appear as dim
metadata under each result. Ranks (#1, #2, …) and confidence badges
(strong / medium / weak) replace raw scores. When the top result is below
the low-confidence threshold (default 0.40), a soft warning banner appears
without hiding results.
| Key / command | Action |
|---|---|
j / k or arrows |
Navigate results |
| Enter (on a result) | Copy matched command(s) to clipboard |
n or /more |
Show more results |
/help |
Show help |
/quit or q |
Quit |
One-shot whatwasit "query" opens the same TUI layout with pre-fetched results.
Use --plain or --headless for line-oriented output.
Configuration
Optional config file: ~/.config/whatwasit/config.toml
output_mode = "tui" # "tui" or "plain"
tui_page_size = 5
low_confidence_threshold = 0.40
use_daemon = true # use warm daemon when running (if started)
CLI flags override config values (for example, --plain forces plain output).
Data directory: ~/.local/share/whatwasit/ (whatwasit.db + index.usearch)
If you indexed under the older hist app name, that data path is still detected
automatically — no re-index required.
History sources: ~/.zsh_history, ~/.bash_history, and Atuin (if installed).
All sources are read non-destructively.
How it works
- Parse — reads shell history into timestamped commands
- Group — clusters commands into sessions by time gap and working directory
- Embed — encodes each session locally with all-MiniLM-L6-v2 (~22 MB ONNX, CPU-only)
- Index — stores vectors in a local index with SQLite metadata
- Search — embeds your query, finds nearest sessions, highlights matching commands within each session
Privacy
- All search and indexing run on your machine
- No network calls after the one-time model download
- Your shell history is never uploaded anywhere
Feedback
Bug reports and feature requests: github.com/ThorOdinson246/whatwasit/issues
License
MIT — see LICENSE.
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 whatwasit-0.1.2.tar.gz.
File metadata
- Download URL: whatwasit-0.1.2.tar.gz
- Upload date:
- Size: 349.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
ebddc5694c44f88fb4c7dbb12c91d74e67ea18ba1fa2e32b1cd1ab5dce101c0d
|
|
| MD5 |
3ba95aef1b6170125c4c8f77915a0075
|
|
| BLAKE2b-256 |
ce1608dcab5ba15d01be5f38bd544451145084d046f95e10e05232d96e55d2e3
|
File details
Details for the file whatwasit-0.1.2-py3-none-any.whl.
File metadata
- Download URL: whatwasit-0.1.2-py3-none-any.whl
- Upload date:
- Size: 43.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
917972e2cc361472ef86bc38133d0b7ee2e8be77a629a5b2813521153f44ddc6
|
|
| MD5 |
1e096bf5f3e82d0078616cc48e774893
|
|
| BLAKE2b-256 |
5646d4174b004898469abed1d6e23ac06a6d42003d577ab5a5235a79073892fa
|