This page contains the user-facing command reference for sdbh.
Note:
sdbhoperates on your history stored in a local SQLite database. Output and previews reflect your recorded usage.
Substring search (case-insensitive):
sdbh search kubectl --all --limit 50
sdbh search "git status" --all --limit 20
sdbh search kubectl --all --format json --limit 10
# time filtering
sdbh search kubectl --all --days 30
sdbh search kubectl --all --since-epoch 1700000000
# interactive fuzzy selection
sdbh search kubectl --fzfGrouped-by-command output (count + last run):
sdbh summary git
sdbh summary --starts git
sdbh summary --pwd --under
# interactive fuzzy selection from command summaries
sdbh summary --fzfRaw history (latest first):
sdbh list --all --limit 50
sdbh list --all --format json
# interactive fuzzy selection
sdbh list --fzfQuick aggregates:
# top commands in last N days
sdbh stats top --all --days 30 --limit 20
# top commands per directory
sdbh stats by-pwd --all --days 30 --limit 20
# commands per day (localtime buckets)
sdbh stats daily --all --days 30sdbh stats top --fzf
sdbh stats by-pwd --fzf
sdbh stats daily --fzf --multi-selectImport/merge an existing dbhist.sh database (hash de-dup):
sdbh import --from ~/.dbhistMultiple sources:
sdbh import --from ~/.dbhist --from /path/other.dbBash:
sdbh import-history --bash ~/.bash_history --pwd "$PWD"Zsh (extended history format):
sdbh import-history --zsh ~/.zsh_history --pwd "$PWD"If a history file doesn’t include timestamps (common for bash), sdbh assigns synthetic sequential timestamps to preserve ordering.
Diagnose your setup (DB access, env vars, and shell integration):
sdbh doctor
sdbh doctor --no-spawn
sdbh doctor --format jsonShow detailed preview information for a command (used by fzf preview):
sdbh preview "git status"