Loading page...Загружаем страницу...正在加载页面...
AtlasRepo

lazy-alias: my shell history writes my aliases, with a 1.5B model on my CPU

说明与用途

lazy‑alias 自动从 bash 历史中提取频繁的多步命令,使用 Qwen 模型为其命名,存储在 TimescaleDB 并附加向量嵌入,支持按语义检索遗忘的别名。

问题

Users repeatedly type multi‑step shell commands and forget the names of the aliases they create for them.

结果

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.

工作流

  • 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

证据

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.

来源

  • 记录日期: 2026-10-26T04:26:13.360Z