On the command line
Look up and translate words in a terminal with wd, which prints what the card would show.
The setup puts wd on the PATH, so it can be run from any folder in PowerShell, the Command Prompt or Windows Terminal. A terminal that was already open needs opening again to find it. It comes only with the installed copy, not with the one that runs without installing.
wd serendipity # or: wd define serendipity
wd translate good morning # or: wd t good morning
wd t buongiorno --to German
Get-Clipboard | wd tLooking up
wd define, or wd d, looks up a word or a short phrase, in the built-in dictionaries and then online, as wd does with a word and no command. When the word isn't found, it says what it was likely a typo of.
| Option | What it does |
|---|---|
-l, --lang <language> | Only in this language, given as a code like it or a name like Italiano. Its dictionary is used if it's been downloaded, whether it's in the settings or not. |
-n, --senses <n> | Senses per part of speech |
-s, --synonyms <n> | Similar words per part of speech, 0 for none |
--examples, --no-examples | Shows the example sentences, or leaves them out |
Translating
wd translate, or wd t, translates a word, a phrase or a passage, as --online.
| Option | What it does |
|---|---|
-f, --from <language> | The language it's in, given as a code like en or a name like English |
-t, --to <language> | The language to translate it into |
Without them, it picks the way as the shortcut does, and says so when it had to guess. Given only --to, it translates from the language the text seems to be in, or from the other default language if it's that one already.
For both
| Option | What it does |
|---|---|
--online | Uses the online dictionaries and translators |
--offline | Uses only the dictionaries on this PC |
-h, --help | Lists the commands and options, as wd help does |
-V, --version | Shows the version |
What isn't given goes by WinDict's settings: its dictionaries, its default languages, what the card shows and the online dictionary. wd reads them, but never changes them.
In scripts
With no text after the command, wd reads it from what's piped in. Text starting with a dash goes after --, as in wd t -- -5 degrees.
In a console, answers are styled and wrapped to the window. Piped or redirected, they're plain lines; set NO_COLOR to have them plain in a console too. What went wrong is written to the error stream, not with the answer.
| Exit code | Meaning |
|---|---|
0 | An answer was printed |
1 | No answer: the word wasn't found, or the lookup or translation failed |
2 | The command couldn't be made sense of, like an unknown option or nothing to look up |