dwim

Source on GitLab · All labs

Do what I mean. Type what you want in bash. When bash finds no command for the line, dwim hands it to a model, which answers with one command. You run it, edit it, or skip it.

$ go to the etc directory and print where I am
→ cd /etc && pwd
[enter] run  [e] edit  [any] skip
/etc

The model is yours to pick: Claude, GPT, Gemini, a model on your own Ollama server, or a small model from Hugging Face that runs on your machine, with no service and no key.

Install

dwim has no release yet, so its packages are not on npm. Once they are, three lines set it up:

npm install --global @wtf/dwim @wtf/dwim-qwen-coder
dwim provider use @wtf/dwim-qwen-coder
echo 'eval "$(dwim shell init bash)"' >> ~/.bashrc

Open a new shell and type what you mean. The first line downloads the local model, 1.8 GB, and loads it. The lines after it answer in a couple of seconds.

Pick a model

A provider package brings the model. There are two:

dwim provider use picks one, and -o sets its options:

dwim provider use @wtf/dwim-ai-sdk                    # Claude Haiku
dwim provider use @wtf/dwim-ai-sdk -o package=openai -o model=gpt-5-mini
dwim provider use @wtf/dwim-qwen-coder -o size=3B
dwim provider show

How it works

Settings

SettingWhat it does
DWIM_OFF=1Leave unknown commands alone.
DWIM_MIN_WORDS=2Lines of fewer words get "command not found".
DWIM_TIMEOUT=120Seconds the hook waits for an answer.

Source

dwim is a pnpm workspace of TypeScript packages: the CLI, its library, the two providers, and its guides, which also show how to write a provider of your own. They are all inits repo on GitLab, under the MIT license.