,, diagnose-then-suggest, polished demo, bash adapter - #8
Merged
Conversation
The previous `,,` was a one-trick pony: it always proposed
REPLACEMENT commands. When the failure wasn't actually a syntax
problem (no such repo, missing file, perms), the model had to pretend
the command was broken — and proposed nonsense fixes for a working
command.
`,,` now does two things in one turn:
1. **Diagnose** — one sentence on WHY the command failed, leading
with a category: 'Typo:', 'Environment:', or 'Logic:'. Printed
to stderr above the picker so the user reads the verdict before
choosing anything.
2. **Suggest 3-5 next commands** appropriate to the category:
- Typo → the corrected command first.
- Environment → the setup that unblocks (`git init`,
`mkdir -p ...`, `chmod +r ...`), then the original command.
- Logic → a different command that achieves the actual goal.
Live verification across both fast (Qwen3.6-35B MoE) and balanced
(Qwen3.6-27B) tiers shows the model correctly categorises typo
errors (du --max-deth, grep --inculde) and environment errors
(no git repo, missing file). Schema is `FIX_SCHEMA` with a
required `diagnosis` field; main schema unchanged.
Demo polish:
- `?? --start fast` is now the first VISIBLE command so viewers
understand a local LLM is being spun up.
- SHELLLM_BASE_URL points at the fast tier in setup, so the
subsequent `,`/`?` beats need no flags. The model-switch beat
(`? --balanced`) shows per-call routing in isolation.
- The `,,` example is now `find . -tpye f -name '*.py'` —
portable (BSD + GNU find both accept `-type`), non-git, fails
with a clean syntax error, and the corrected command actually
succeeds in the sandbox (`./build.py`).
README, CONFIGURATION.md, AGENTS.md:
- README rewritten for public/professional tone. Drops the
in-jokes, leads with a confident pitch, links cleanly out to
the deep docs.
- New `bash/shellllm.bash` adapter exposes the same Python CLIs
under `llmc`, `llmcc`, `llmf`, `llma`, `llmm` for non-zsh
users; uses bash-preexec when available, falls back to $?
otherwise.
- CONFIGURATION.md gets a 'Using shellllm without zsh' section
documenting both the adapter and direct CLI usage.
- Homebrew formula now installs `shellllm.bash` alongside
`shellllm.zsh` and tests for both.
260 tests pass; ruff clean.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
,,becomes diagnose-then-suggestThe previous repair flow was locked to "propose REPLACEMENT commands". When the failure wasn't actually syntactic — no such repo, missing file, perms — the model had to pretend the command was broken and produced nonsense fixes for a working command.
,,now does two things in one turn:Typo:,Environment:, orLogic:. Printed to stderr above the picker so the user reads the verdict before choosing anything.git init,mkdir -p ...,chmod +r ...), then the original commandSchema-level change: new
FIX_SCHEMAwith a requireddiagnosisfield; mainSCHEMAis unchanged. The diagnosis surfaces via the existing↻stderr hint style, so plain,is unaffected.Live verification across both tiers confirms the model categorises correctly:
du -h --max-deth=1Typo: \--max-deth` should be `--max-depth`.`grep --inculde='*.py'Typo: '--inculde' is misspelled...git login non-repoLogic:(close)Environment: not inside a git repository.cat nonexistent.confEnvironment: The file ... does not exist.Demo polish
?? --start fastis now the first visible command — the audience sees there's a local LLM coming up, not just text appearing out of nowhere.SHELLLM_BASE_URLpoints at the fast tier in setup, so the subsequent,/?beats need no flags. The model-switch beat (? --balanced) shows per-call routing in isolation rather than spamming--fasteverywhere.,,example is now `find . -tpye f -name '*.py'` — portable across BSD and GNU find, non-git, fails with a clean syntax error, and the corrected command actually succeeds in the sandbox (outputs./build.py).README polished for public release
Bash adapter for non-zsh users
The zsh integration ships the punctuation glyphs (
,,,??????), which depend on zsh-specific features (noglob, aliasing characters bash treats as wildcards). Newbash/shellllm.bashexposes the same Python CLIs under short alphabetic aliases:llmcllmccllmfllmallmmUses
bash-preexecwhen available, falls back to$?capture otherwise. CONFIGURATION.md gets a "Using shellllm without zsh" section; the Homebrew formula installs the bash file alongside the zsh file.Test plan
pytest -q) — new coverage forFIX_SCHEMAselection, stderr diagnosis line, fix-mode-only behaviorruff checkandruff format --checkclean↻ Typo: \-tpye` should be `-type`.`) and fix successfully executedllmfafter a failing command