A local-first command-line memory for developers. devmem records the commands you run in your terminal and lets you search them later. All data stays on your machine.
Status: early development. Shell capture, ingest, keyword search and the
dmCLI work and are tested.
terminal --(zsh hook)--> spool file --(dm ingest)--> SQLite database --(dm search)--> results
- Hook (
devmem.zsh) runs inside zsh. After each command it appends one tab-separated line to a spool file: start time, duration, exit code, working directory and command. Special characters are escaped so each event is one line. The hook never prints errors and skips commands that start with a space. - Ingest (
src/devmem/ingest.py) reads only new, complete lines from the spool using a stored byte offset, skips malformed lines, and writes rows and the new offset in a single transaction, so repeated runs never create duplicates. - Database (
src/devmem/db.py) is SQLite in WAL mode with an FTS5 full-text index. Numbered SQL migrations insrc/devmem/migrations/are applied automatically.
-
Python 3.12+
-
uv (recommended) or
venv+pip -
zsh 5.x
-
SQLite with FTS5 (included in most Python builds). To check:
python3 -c "import sqlite3; sqlite3.connect(':memory:').execute('create virtual table t using fts5(x)'); print('FTS5 OK')"
git clone https://github.com/S-Roomi/devmem.git
cd devmem
uv syncThen enable the shell hook by adding this near the end of ~/.zshrc and opening a new
terminal:
source /path/to/devmem/devmem.zshdm ingest # load new commands from the spool into the database
dm search docker compose # search recorded commands, newest first
dm recent -n 50 # show the 50 most recent commands
dm status # diagnose the spool, database and ingest progressRun these with uv run dm ... if the virtualenv is not activated. search and recent
ingest new history automatically before running. Failed commands are shown in red.
| File | Default location | Override |
|---|---|---|
| Spool | ~/.local/state/devmem/spool |
DEVMEM_SPOOL (or XDG_STATE_HOME) |
| Database | ~/.local/share/devmem/devmem.db |
XDG_DATA_HOME |
uv run pytest # run the test suite
uv run ruff check # lint
uv run mypy src # type-checkTests use temporary files and databases and never touch your real history.
- The spool and database contain everything you type, including any secrets passed on the command line. Both are created with owner-only permissions.
- Secret redaction is not implemented yet. Prefix a command with a space to keep it out
of the log (e.g.
export TOKEN=...). - Never commit
*.db,*.db-wal,*.db-shmor the spool file; they are in.gitignore - Nothing leaves your machine