🤖 AI Summary
qq.fish is a compact Fish-shell helper that turns a locally hosted LLM (via LMStudio’s lms CLI) into a tiny terminal assistant that proposes 1–2 concrete shell commands for a user query. The script ships with a strict SYSTEM_PROMPT that forces the model to only output short command suggestions (wrapped in <cmd> tags) or a fixed off‑topic warning format, colorizes the model output for readability, and then lets the user either accept (Enter) to inject the command into the shell or retry (r). By default it calls the qwen2.5-coder-1.5b-instruct model but you can override MODEL via QQ_MODEL.
Technically, qq.fish is a straightforward pattern for a privacy-preserving, offline command assistant: it shells out to lms chat -s "$SYSTEM_PROMPT" -p "$argv" "$MODEL", transforms tagged responses with sed to colorize and format, extracts <cmd> blocks using rg+sed, trims them, and uses fish’s commandline -r to populate the prompt. The prompt-engineering enforces deterministic structure (reducing hallucinations) and the integration with fish makes suggested commands one keystroke from execution. Requirements/limits: LMStudio (lms) and the model must be installed locally, and the helper assumes a NixOS-oriented system prompt and small code-focused model — a useful, extensible template for local, low-latency developer assistants.
Loading comments...
login to comment
loading comments...
no comments yet