Skip to content

,, diagnose-then-suggest, polished demo, bash adapter - #8

Merged
FrancoisChastel merged 1 commit into
mainfrom
feat/cli-redesign-recall
Jun 14, 2026
Merged

,, diagnose-then-suggest, polished demo, bash adapter#8
FrancoisChastel merged 1 commit into
mainfrom
feat/cli-redesign-recall

Conversation

@FrancoisChastel

Copy link
Copy Markdown
Owner

Summary

,, becomes diagnose-then-suggest

The 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:

  1. Diagnose — one short 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

Schema-level change: new FIX_SCHEMA with a required diagnosis field; main SCHEMA is unchanged. The diagnosis surfaces via the existing stderr hint style, so plain , is unaffected.

Live verification across both tiers confirms the model categorises correctly:

Case Fast (35B-A3B-MTP) Balanced (27B)
du -h --max-deth=1 Typo: \--max-deth` should be `--max-depth`.` same
grep --inculde='*.py' Typo: '--inculde' is misspelled... same
git log in non-repo Logic: (close) Environment: not inside a git repository.
cat nonexistent.conf Environment: The file ... does not exist. same

Demo polish

  • ?? --start fast is now the first visible command — the audience sees there's a local LLM coming up, not just text appearing out of nowhere.
  • 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 rather than spamming --fast everywhere.
  • The ,, 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

  • Rewritten in a confident, professional voice — fewer in-jokes, clearer positioning.
  • Three-step install up top, the five-glyph table, a few "moves worth knowing", and clean links into CONFIGURATION.md for the deep stuff.
  • New top-level Design section names the load-bearing invariants (`,` never executes, the filesystem hard wall, the terminal-context ladder, sticky-per-pane sessions).

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). New bash/shellllm.bash exposes the same Python CLIs under short alphabetic aliases:

Alias Purpose
llmc propose commands
llmcc propose with terminal context
llmf fix the previous command (bare `,,`)
llma ask
llmm memory / recall

Uses bash-preexec when 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

  • 260 tests pass (pytest -q) — new coverage for FIX_SCHEMA selection, stderr diagnosis line, fix-mode-only behavior
  • ruff check and ruff format --check clean
  • Live model verification — diagnoses correctly classified across both tiers, two typo cases, two env cases
  • Demo renders end-to-end with diagnose line visible (↻ Typo: \-tpye` should be `-type`.`) and fix successfully executed
  • Manual: source bash adapter from `.bashrc`, exercise llmf after a failing command

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.
@FrancoisChastel
FrancoisChastel merged commit f04b246 into main Jun 14, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant