feat(ai): default to NL2SH + add -q/--quiet for non-interactive output

Make westenfelder/NL2SH the default `ai` model (most accurate in the
25-query benchmark, only model handling hard multi-stage tasks) and add a
-q/--quiet/--raw flag that prints just the generated command to stdout
(errors to stderr) so `ai` composes in scripts and pipelines.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
leetcrypt
2026-06-09 16:49:31 -07:00
parent f4060a25d3
commit 2458e8a4f7
2 changed files with 64 additions and 31 deletions
+22 -9
View File
@@ -34,22 +34,35 @@ super-man ai "count lines in js files" # AI bash one-liner via local LLM (advan
### AI mode (local LLM via ollama)
`ai` generates a bash one-liner from plain English using a local [ollama](https://ollama.com)
model. The model is configurable, so you can A/B different local LLMs:
model. The default is `westenfelder/NL2SH`, a model purpose-built for
natural-language-to-shell — in our 25-query benchmark it was the most accurate, the
only one that handled hard multi-stage tasks. The model is configurable, so you can
still A/B other local LLMs:
```bash
super-man ai "find python files modified last week" # default model
super-man ai --model qwen2.5:3b "count lines in all js files" # override model
super-man ai --compare "list the 5 largest files" # run several models side by side
super-man ai "find python files modified last week" # default model (NL2SH)
super-man ai -q "list the 5 largest files" # quiet: print ONLY the command
super-man ai --model qwen2.5-coder:1.5b "count lines in js" # override model
super-man ai --compare "list the 5 largest files" # run several models side by side
```
The `-q` / `--quiet` / `--raw` flag prints only the generated command to stdout (errors
go to stderr), so it composes in scripts and pipelines:
```bash
cmd=$(super-man ai -q "compress the logs folder into a tarball")
echo "$cmd" # tar -czf logs.tar.gz logs/
```
| Env var | Purpose | Default |
|---------|---------|---------|
| `SUPERMAN_AI_MODEL` | Default model for `ai` | `qwen2.5-coder:1.5b` |
| `SUPERMAN_AI_COMPARE_MODELS` | Space-separated list for `--compare` | `qwen2.5-coder:1.5b westenfelder/NL2SH` |
| `SUPERMAN_AI_MODEL` | Default model for `ai` | `westenfelder/NL2SH` |
| `SUPERMAN_AI_COMPARE_MODELS` | Space-separated list for `--compare` | `westenfelder/NL2SH qwen2.5-coder:1.5b` |
General coder models (e.g. `qwen2.5-coder`) are prompt-wrapped to emit a single bare
command; the purpose-built `westenfelder/NL2SH` model receives the raw query. Pull
either with `ollama pull <model>`.
The purpose-built `westenfelder/NL2SH` model receives the raw query; general coder
models (e.g. `qwen2.5-coder`) are prompt-wrapped to emit a single bare command. Pull
either with `ollama pull <model>`. See the
[benchmark write-up](tests/performance/) for the full model comparison.
`Esc` in the flag browser returns to the command list; `Esc` on the home screen
exits.