Stop googling shell commands.
Type what you want in plain English, get the command on your prompt, fitted to your OS and installed tools. It runs on a local model, checks the web only when that fails, and nothing runs until you press Enter.
Web lookup powered by tiny-browse$ npm install -g @shubhamcodess/whatcmd
Then run whatcmd init once. Needs Node 22+ and Ollama;
init checks both and downloads the model.
What's new in 1.0
Keep shaping a command instead of retyping it, and get the hard ones right with the official docs, without giving up the local-first default.
-
refine · /w+
Change the last command in place
Say what to change and whatcmd edits this terminal's last command, or your edited version of it. After a failed run,
/w+ fix thatknows the exit status.$ /w find files bigger than 100MB ↵
$ /w+ only pdfs ↵
$ find . -type f -name '*.pdf' -size +100M -
web lookup · tiny-browse
Looks it up only when the local answer fails
When the model doesn't know a tool, like
kubectl, whose--helplists no flags, or its answer fails the checks, whatcmd reads the official docs and tries again. Correct answers never touch the network.$ /w kubectl show rollout history of deployment web ↵
$ kubectl rollout history deployment/web
used web docs from kubernetes.io -
shortcut polish
A spinner, and Enter to clear
A small spinner shows while whatcmd works (Ctrl-C stops it). When nothing was generated, the next Enter clears the line so you can type again.
Cloud-CLI benchmark (40 kubectl, helm, gcloud… cases): 22 / 40 local only, 25 / 40 with web lookup. Everyday, refusal and refinement cases score the same either way. Full changelog →
A copilot for the prompt, not a chatbot.
Small, fast and deliberately boring: one request, one command, on your line. The interesting part is everything that keeps that command correct and safe.
-
01 · prefill, never run
Nothing runs until you press Enter
The command replaces your typed line. Check it, edit it, or run it. whatcmd never executes anything by itself.
$ /w kill whatever is on port 3000 ↵
$ lsof -ti :3000 | xargs kill -
02 · knows your system
Commands for your OS, not someone's blog
Detects OS, distro, shell, package manager, GNU vs BSD flags and which tools you have. On a Mac you get
sed -i ''andvm_stat, not Linux-only flags. -
03 · grounded in local docs
Reads the man page of the tool you named
Mention
jq,ffmpegorkubectland the relevant lines of its man page or--helpgo into the prompt, so flags match your installed version. -
04 · says nothing when it should
Not a shell task? No output.
"tell me a joke" or "what is 15% of 240" produce nothing. Chat replies, calculator answers and prompt injections are filtered before they reach your line.
-
05 · warns before damage
Flags the commands that bite
rm -r,dd,mkfs,curl | sh, force pushes, world-writablechmodand placeholders like/path/tocome with a warning. -
06 · refine with /w+ new in 1.0
Keep shaping the last command
/w+ only pdfs,/w+ then zip them,/w+ fix that. Up to five refinements per tab, then it asks you to start fresh.
/w <request>, prefix configurablewhatcmd <request>How it works
Every request goes through the same short pipeline. The web is the last resort, not the first step.
- 1
Profile
OS, distro, shell, package manager, GNU or BSD flags and installed tools, detected once and stored.
- 2
Grounding
Tools your request names pull in the matching lines of their man page or
--help, cached per version. - 3
Local model
Ollama gets the profile, a few examples and the docs, and must answer with one command or
NONE. - 4
Gate and retries
Chat text, echoes, loops and missing tools are caught. A targeted hint gets one more try.
- 5
Web lookup, only if it still fails
The model said it doesn't know, or the answer still fails: tiny-browse fetches the docs, and the model answers again.
- 6
Your prompt line
The command lands on your line with any risk warnings. You read it, then press Enter.
tiny-browse: web search and page reading for agents
tiny-browse is a separate open-source package by the same author: it searches the web in the Chrome you already have and returns clean Markdown within a token budget. It ships as an MCP server and as a Node.js library with zero dependencies. whatcmd installs it as a dependency and calls the library in the same process.
tiny-browse on GitHub- Reference pages firstFor kubectl, helm, gcloud, az, gh and others, the official cheat sheet is read over plain HTTP: no Chrome, no search engine. Cached for 7 days; matching lines are picked locally.
- Then a searchOtherwise one web search, reading the top 2 results, and only the lines that mention your tool go to the model, labelled as examples.
- Polite by designtiny-browse's shared rate limits apply (Google: 8 s apart, 20 an hour). whatcmd searches at most once per request, never retries a block, and pauses for 15 minutes when every engine refuses.
- What leaves your machineThe tool name and plain words of the request. Paths, flags,
key=valuepairs and long numbers are removed. Turn it off withwhatcmd config set web false.
Measured on 500 cases, not promised.
Every release candidate runs the same 500-case benchmark: command generation, refusals, grounding, safety, OS fit, plus the CLI, config and shell hook. The numbers below are copied from the latest report, run on an Apple M4 Pro with Ollama 0.40.14 and the default model.
Grounding is doing real work
20 cases on made-up CLIs whose flags exist only in their --help
Why the 1.5b model is the default
the same 150 command-generation cases
One machine, one Ollama version. Small local models still make mistakes, which is exactly why whatcmd never runs a command for you. Read it, then press Enter.