lazy-alias: my shell history writes my aliases, with a 1.5B model on my CPU
Description and use
lazy‑alias automatically extracts frequent multi‑step commands from bash history, names them with a Qwen model, stores them in TimescaleDB with vector embeddings, and lets users retrieve forgotten aliases by meaning.
Problem
Users repeatedly type multi‑step shell commands and forget the names of the aliases they create for them.
Outcome
On a synthetic 30‑day history, lazy‑alias identified four frequent multi‑step habits, reducing 147 retyped commands to single‑word aliases and enabling semantic retrieval of forgotten aliases.
Workflow
- 1. ingest bash history into a TimescaleDB hypertable
- 2. use SQL window functions to pair commands within 5‑minute gaps and count frequent 2‑ or 3‑step sequences
- 3. run Qwen2.5‑1.5B‑Instruct via llama.cpp on CPU to generate a name and description for each sequence
- 4. sanitize and store approved aliases with a tsvector and a 384‑dim all‑MiniLM‑L6‑v2 embedding in pgvector
- 5. provide a find command that performs hybrid keyword + vector search with reciprocal‑rank fusion to retrieve aliases by meaning or keyword
Evidence
lazy‑alias reads your bash history, finds the 2-3 step command sequences you keep retyping, and asks a small open‑weight model running on your CPU to name each one as a shell function.
It returns JSON with a name and a one‑line description; the name is sanitized into a valid, unique shell identifier.
Each approved function is stored with a tsvector and a 384‑dim all‑MiniLM‑L6‑v2 embedding in a pgvector column.
On the demo history, lazy‑alias found four habits… That's 147 multi‑step retypes that become one word each.
- Record date: 2026-10-26T04:26:13.360Z