v0.1.0 · open source · local-first npm

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.

zsh · ~/projects/site
Commands land on your prompt. You press Enter, or edit them first.
v1.0.0 · first stable release · release notes

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.

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.

local-firstOllama + qwen2.5-coder, no API keys, no telemetry
bash · zshone shortcut: /w <request>, prefix configurable
macOS · LinuxWindows shells can use whatcmd <request>
MITopen source, ~25 kB package

How it works

Every request goes through the same short pipeline. The web is the last resort, not the first step.

  1. 1

    Profile

    OS, distro, shell, package manager, GNU or BSD flags and installed tools, detected once and stored.

  2. 2

    Grounding

    Tools your request names pull in the matching lines of their man page or --help, cached per version.

  3. 3

    Local model

    Ollama gets the profile, a few examples and the docs, and must answer with one command or NONE.

  4. 4

    Gate and retries

    Chat text, echoes, loops and missing tools are caught. A targeted hint gets one more try.

  5. 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. 6

    Your prompt line

    The command lands on your line with any risk warnings. You read it, then press Enter.

built on

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=value pairs and long numbers are removed. Turn it off with whatcmd 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.

Overallall scored cases
454 / 490 passed10 bash hook cases skipped: macOS ships bash 3.2
92.7%
Refuses non-shell questionsrefusal
79 / 80jokes, trivia, math, injections
98.8%
Writes the right commandgeneration
127 / 150files, text, processes, network, git, docker…
84.7%
Uses your installed tools' docsgrounding
44 / 50incl. made-up tools only the docs describe
88%
Warns on dangerous commandsrisk
38 / 40rm -r, dd, curl | sh, force push…
95%
Handles tools you don't havemissing_tool
30 / 30picks an alternative or warns, never silent
100%
Fits your OSprofile
16 / 20BSD flags, brew services, pbcopy…
80%
CLI, config, gate, shell hookdeterministic
120 / 120exit codes, settings, output checks, zsh hook
100%
121 mstypical model answer (p50)
217 msend to end incl. Node startup
0.8 sfirst request after the model unloads
50 / 50identical output across 3 re-runs

Grounding is doing real work

20 cases on made-up CLIs whose flags exist only in their --help

docs on
85%
docs off
0%

Why the 1.5b model is the default

the same 150 command-generation cases

1.5b
84.7%
0.5b
66%

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.