dwiw
do what i want
THE POINT
You should have to think as little as possible.
No capital letter to remember. No exclamation mark. No prefix. No mode to
switch into. You type a line and press Enter, the same as you always have.
ls src runs, instantly, as a command
fix the last failure becomes a command proposal
what does this repo do inspects files, then answers
That is the whole interface. dwiw looks at the line and decides. A command
runs as a command. A request may return an answer, inspect or edit workspace
files, or produce a shell command sitting on your prompt, which you can edit
or delete before it runs. You can configure dwiw to run safe proposals
immediately instead.
One line in, one finished result out. Press Enter.
Other overlays make you mark your intent. Butterfish, for example, needs
you to start a prompt with a capital letter. That is a small tax, but you
pay it on every single line, forever, and you pay it in the one place where
you were not thinking about anything except the task. dwiw does not charge
it.
IT COSTS NOTHING TO TYPE A COMMAND
The router is local. It is plain code -- a resolution table of what is
actually on your PATH, plus lexical analysis of the line. There is no model
call in the routing path.
So `git status` costs zero tokens and zero added latency. A model is only
consulted once the line has already been classified as a request. Tools
that send every keystroke to an API cannot make that promise.
Resolution is evidence, not a veto. A real command called `what` may exist,
but `what does this repo do?` is still sentence-shaped and routes as a request;
`what ./file.c` remains a native command. The same local rule handles other
English collisions without requiring a prefix.
ROUTER VALIDATION
The checked-in corpus is a hand-authored regression suite. It proves that
known cases stay fixed; it is not an accuracy benchmark and must not be
reported as one.
For accuracy work, freeze an external labeled JSONL dataset before running
the router. Each row supplies an id, line, command-or-intent label, clusterId,
and whether its first token resolves in the evaluated shell environment.
Paraphrases and command/request pairs share a clusterId so they cannot leak
between deterministic train, development, and holdout splits.
bun run evaluate:router external.jsonl holdout dwiw-router-v1 100 aggregate
The report keeps the two consequential errors separate: false-command rate
for requests that would execute in the shell, and false-request rate for
commands that would be sent to the agent. Since the runtime currently executes
an ambiguous route, ambiguity counts as a false command for a true request.
The report includes Wilson 95% intervals, whole-cluster accuracy, source and
category buckets, and warmed p50/p95/p99 router latency. Aggregate mode omits
the held-out text; details mode reveals failed lines and is for development
data only. Do not tune against a reported holdout.
INSTALL
dwiw ships as a single self-contained binary. No runtime required on the
target machine.
From source:
git clone https://github.com/plyght/dwiw.git
cd dwiw
bun install
bun run install:local
That builds `dist/dwiw` and copies it to ~/.local/bin/dwiw. No sudo. Set
DWIW_PREFIX to install somewhere else:
DWIW_PREFIX=/usr/local/bin bun run install:local
If ~/.local/bin is not on your PATH yet:
fish fish_add_path ~/.local/bin
bash/zsh export PATH="$HOME/.local/bin:$PATH"
From a release tarball, pick the archive matching your platform
(darwin-arm64, darwin-x64, linux-x64), then:
tar -xzf dwiw-<version>-<platform>.tar.gz
install -m 755 dwiw ~/.local/bin/dwiw
USE
dwiw
The first interactive run opens a short setup flow, then starts the overlay:
your own shell, wrapped, with routing on top. Existing installs see the flow
once after upgrading. Setup asks how proposals should behave and which model
provider to use. Run `dwiw setup` whenever you want to change those choices.
Your current choices are selected when you run it again. Then just type.
Run `dwiw model` to choose a model from your connected providers. It uses
your saved Codex login, OPENAI_API_KEY, or ANTHROPIC_API_KEY. Type to filter
models. Supported OpenAI models also offer Fast or Ultrafast. Selections
are saved and used on the next request. Faster tiers can use more credits.
First-run setup is skipped when stdin is not an interactive terminal, so
scripts do not get stuck waiting for answers. `dwiw setup` requires an
interactive terminal and exits with an explanation otherwise.
ls src
fix the last failure
what is eating port 3000
what does this repo do
change the version in package.json to 0.2.0
git log --oneline -5
By default, requests arrive as a proposal on your prompt. Accept it, edit it,
or clear the line. Set autoRun to true to run proposals immediately unless a
safety setting requires review.
DWIW IS A BOUNDED AGENT
Dwiw can take several foreground steps inside one request. It can list files,
search text, read UTF-8 files, and make one exact replacement at a time. These
tools are restricted to the current workspace, reject symlink escapes, cap
their output, and stop after a bounded number of calls. There is no arbitrary
shell tool, autonomous background task, or work to check on later.
Assistant progress, every tool call, and the final answer remain visible in
order as a permanent terminal transcript:
i’ll take a look!
list_files
read_file package.json
search_text "version"
replace_text package.json
session_history "timeout"
sdt_history why src/config.ts
this repo does xyz
Each tool call gets its own line. Progress and tool lines are never inserted
into the editable prompt, and raw tool arguments and file contents are not
printed. When the answer finishes, the normal shell prompt returns. Only a
final shell-command proposal can populate that prompt.
Dwiw keeps exactly one recent user-and-agent exchange in the live prompt for
short follow-ups. It also writes a compact private local session journal under
~/.dwiw/sessions. The journal records completed requests, answers, tool
outcomes, and bounded before/after descriptions for exact replacements. Older
context is never loaded automatically: the agent can call session_history when a
request depends on prior work, and can optionally call sdt_history inside an
sdt repository when it needs exact file-change provenance. Those calls appear
as the same minimal activity lines as every other tool call, never as shell
commands or editable prompt contents.
Native commands perform no session-history or VCS work. Ordinary AI requests
also skip journal and sdt lookup unless the agent explicitly calls a history
tool, keeping the normal path fast and unnoticeable.
When a job needs arbitrary commands, broad code generation, a long plan, or
many files, reach for a full agent. Claude Code and Codex remain native
commands and dwiw stays out of the way:
claude fix the failing integration tests
codex refactor this module
Lines that begin with a known agent CLI pass straight through and run
natively, untouched. dwiw hands off cleanly rather than trying to compete.
ESCAPE HATCHES
The prefixes are overrides, not the normal way in. You will rarely need
them. They exist for the case where the router guessed wrong, or where you
already know what you want and would rather not find out.
!! force the line to be treated as a request
:: force the line to be treated as a shell command
!!fix the last failure
::show current directory
If you find yourself reaching for a prefix often, that is a routing bug
worth reporting.
SHELLS
fish, Bash 4 or newer, and zsh. The `script` command must be available; dwiw uses it
to give the wrapped shell a real tty. A window resize is applied to that
inner tty directly, because `script` does not forward one.
The overlay only starts on an interactive terminal. When stdin or stdout is
not a tty -- a script, an editor task, Raycast -- dwiw exits without taking
over so the command you asked for still runs. Set DWIW_DISABLE to skip the
overlay even on a terminal.
PROVIDERS
Connect any of these providers to give dwiw a model.
OpenAI Codex, over OAuth:
dwiw login
Credentials are stored locally. `dwiw logout` removes them.
OpenAI API, with OPENAI_API_KEY in your environment. Run `dwiw model` and
choose OpenAI API.
Anthropic, over an API key:
export ANTHROPIC_API_KEY=...
If neither is configured, routing still works -- the local router does not
need a model -- but requests print an error and return to an empty prompt.
When no provider is pinned in config, dwiw picks one: Codex if you are
signed in (default model gpt-5.6-luna), then Anthropic if its key is set
(default model claude-haiku-4-5), then OpenAI API if its key is set
(default model gpt-5.6-luna).
For an AI request, dwiw sends the provider your cwd, up to 20 recent routed
lines, the most recent command output, recalled memory, and exactly one recent
user-and-agent exchange. When the agent reads or searches files, the matching
file content is also returned to the provider so it can choose the next step.
Older session history and sdt provenance are sent only when the agent calls the
corresponding tool. Context and tool output are capped and common credential
formats in shell context are redacted first, but pattern-based redaction cannot
guarantee that every possible secret format is removed.
COMMANDS
dwiw start the shell overlay
dwiw setup configure proposal behavior and model provider
dwiw model choose a model and speed for your connected providers
dwiw login sign in to OpenAI Codex (OAuth)
dwiw logout remove saved Codex credentials
dwiw --help print this list
`dwiw route` and `dwiw ask` also exist. They are the interface the shell
integration talks to, not something you invoke by hand.
CONFIG
~/.dwiw/config.json
The first-run setup flow creates this file. `dwiw setup` updates it later.
You can also edit it directly.
Every field, with its default:
{
"autoRun": false,
"destructiveGuard": true,
"confirmAll": false,
"provider": "",
"model": "",
"speed": "standard",
"plugins": [],
"onboardingComplete": false
}
autoRun true runs proposals immediately when no safety setting
requires review. false leaves them editable.
destructiveGuard true warns when a proposed command looks
destructive (rm -rf, dd if=, git push --force,
redirects into /dev/) and leaves it editable.
confirmAll true warns on every proposed command, destructive or
not, and leaves it editable.
provider "openai-codex", "openai", or "anthropic". Empty means choose
automatically.
model model id for that provider. Empty means use the
provider default.
speed "standard", "fast", or "ultrafast". Faster speeds
depend on the OpenAI model and account.
plugins absolute paths to plugin modules.
onboardingComplete
records that first-run setup finished. Use `dwiw setup`
instead of changing this field by hand.
Environment variables override the corresponding fields: DWIW_PROVIDER,
DWIW_MODEL, and DWIW_PLUGINS (colon-separated paths).
PLUGINS
docs/plugins.md
DEVELOPMENT
bun install
bun run dev run from source
bun run check typecheck + lint + test
bun run format format
bun run build compile dist/dwiw for this machine
bun run build:all compile all three platform binaries
bun run release v0.2.0 build, package, and print the gh release
command (dry run by default)