Skip to content

,, becomes one-shot: top fix on the prompt line, --pick for alternatives - #10

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

,, becomes one-shot: top fix on the prompt line, --pick for alternatives#10
FrancoisChastel merged 1 commit into
mainfrom
feat/cli-redesign-recall

Conversation

@FrancoisChastel

Copy link
Copy Markdown
Owner

Summary

Before this PR, ,, always opened the fzf picker, even for obvious typos (-tpye-type). One keystroke too many for the common case. And ,, <prompt> was overloaded — sometimes "fix with intent", sometimes "propose with context" — which left the model guessing.

After:

Invocation Behavior
,, One-shot fix. Top suggestion drops on the prompt line; diagnosis prints above. User reads both, hits Enter to run, or edits, or Ctrl-C. Never auto-executes.
,, <intent> Same flow, but the intent narrows the model (,, use ripgrep, ,, I meant the dev branch).
,, --pick [intent] Escape hatch — full picker for ambiguous cases where alternatives matter.
, --ctx <prompt> The old "propose with context" use case — moves to a flag on , since it's refinement, not repair.

What changed

  • comma.py adds --pick. In fix mode the default path is now chosen = items[0]["command"], skipping _pick() entirely; --pick restores the picker.
  • The ,, zsh function always invokes --fix. It pops a leading tier flag (--fast/--balanced/--smart) for routing, recognises --pick anywhere in the args, and treats everything else as intent.
  • Bash adapter (llmf) mirrors the same shape.
  • The , --ctx <prompt> flag already existed; the migration is documentation telling users where to go.

The comma never executes invariant stays intact: print -z puts the command on the next prompt line; the user's finger on Enter is what runs it.

Demo

Beat 2 is one keystroke shorter — diagnosis line and the corrected find . -type f -name '*.py' land together. The audience reads both, then Enter to run. New gif rendered, committed in this PR.

Test plan

  • pytest -q clean (264 tests, 4 new):
    • bare --fix prints top suggestion to stdout, does not invoke _pick
    • --fix --pick restores the picker path
    • --pick coexists with a free-form intent (both reach the model)
    • plain , still uses the picker
  • ruff check and ruff format --check clean
  • Demo renders end-to-end with no-picker fix flow visible
  • Manual: source updated zsh/shellllm.zsh, run a failing command, verify ,, drops the corrected command on the prompt line ready for Enter

Before: `,,` always opened the fzf picker, even for obvious typos
(`-tpye` → `-type`). One keystroke too many for the common case.
And `,, <prompt>` was overloaded — sometimes "fix with intent",
sometimes "propose with context" — which made the model guess.

After:

  ,,                    one-shot fix. Top suggestion drops on the
                        prompt line via `print -z`; diagnosis prints
                        above. User reads both, hits Enter to run, or
                        edits, or Ctrl-C. Never auto-executes.

  ,, <intent>           same flow, but the intent narrows the model
                        ("use ripgrep", "I meant the dev branch").

  ,, --pick [intent]    escape hatch — full picker for ambiguous
                        cases where alternatives matter.

  , --ctx <prompt>      the old "propose with context" use case
                        moves to a flag on `,` since it's
                        refinement, not repair.

Implementation:

- comma.py adds `--pick`. In fix mode the default is `chosen =
  items[0]["command"]`, bypassing `_pick()`. `--pick` restores the
  picker path. `--ctx` and `--fix` are otherwise mutually exclusive.

- The `,,` zsh function always invokes `--fix`. It pops a leading
  tier flag for routing (--fast/--balanced/--smart) and a `--pick`
  flag anywhere in the args; everything else becomes intent. Bash
  adapter (`llmf`) mirrors the shape.

- `, --ctx <prompt>` already existed as a flag, so the migration is
  just the docs telling users where to go.

The "comma never executes" invariant stays — `print -z` puts the
command on the next prompt line, the user's finger on Enter is what
runs it.

Demo Beat 2 gets one keystroke shorter — the diagnosis line and
corrected `find . -type f -name '*.py'` land together, the user
just confirms.

Tests added: bare --fix prints top to stdout without `_pick`;
`--fix --pick` restores the picker; `--pick` coexists with a
free-form intent; plain `,` still uses the picker. 264 tests pass.
@FrancoisChastel
FrancoisChastel merged commit ec4f3fa into main Jun 15, 2026
2 checks passed
@FrancoisChastel
FrancoisChastel deleted the feat/cli-redesign-recall branch June 15, 2026 00:14
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