ai newsDi., 20. Okt.
EilmeldungAI agent observability: what to record and why

I taught a local LLM to be lazy on my behalf (sloth-alias)

This is my submission for the Hacktoberfest Open-Source AI Challenge: Week 3 (Slow and Steady). What I built sloth-alias reads a shell history file, finds the commands and command sequences you keep retyping, and turns them into aliases. A local open-weight model (any Ollama model, default gemma3:4

dev.toDienstag 04:12 路 20.10.1 Min. Lesezeit
Bild: dev.to

Hacktoberfest Open-Source AI Challenge Week 3: Slow and Steady Submission 馃Ε

This is my submission for the Hacktoberfest Open-Source AI Challenge: Week 3 (Slow and Steady).

sloth-alias reads a shell history file, finds the commands and command sequences you keep retyping, and turns them into aliases. A local open-weight model (any Ollama model, default gemma3:4b ) does one job: it names each shortcut and describes it in a few words.

$ python3 sloth_alias.py sample_history.txt # gemma3:4b via Ollama deploy x3 saves 228 keystrokes <- git push origin main && docker compose up -d --build &&... commit x4 saves 196 keystrokes <- git add -A && git commit -m wip && git push origin main commit2 x4 saves 152 keystrokes <- git status && git add -A && git commit -m wip Total lazy payoff: 576 keystrokes (~2.9 min at 40 wpm). Enter fullscreen mode Exit fullscreen mode Single file, Python standard library only, zero dependencies.

Shell history is some of the most sensitive text on a developer machine: hostnames, paths, tokens pasted by accident. This is exactly the data you should not ship to a hosted API. With an open-weight model on localhost, the history stays on disk, it costs nothing per run, and I can swap models with one flag ( --model ).

On the bundled 26-line sample history, it finds 576 keystrokes of savings, about 3 minutes of typing, in one run. That sample is synthetic; on a real history the repeats compound.

https://github.com/Tinhomagri/sloth-alias

Overlap handling between sequences (right now status && add && commit and add && commit && push can both be suggested, as the commit2 name above shows), and a --explain mode that lets the model flag dangerous aliases such as ones containing rm -rf.

Quelle: dev.to (dev.to). Original 枚ffnen