DDGR(1)
ddgr ๐ the DuckDuckGo-in-your-terminal bestie
okay so first things first, bestie: this whole page is the manual for ddgr, and it lives in the User Commands section of your man pages, and it's ddgr(1). yes it's a man page. yes it's about to be cute. let's GO ๐ฆ
โจ NAME โจ
ddgr โ DuckDuckGo from the terminal ๐ฆ๐ป
โจ SYNOPSIS โจ
ddgr [OPTIONS] [KEYWORD [KEYWORD ...]]
โจ DESCRIPTION โจ
okay so ddgr is a command-line tool that lets you search DuckDuckGo (the html version, specifically) straight from your terminal, no browser tab chaos required ๐
For every result it shows you the title, the URL and the text context. Results come in pages, and there are keyboard shortcuts for flipping between those pages. Every result gets an index number, and you can pop a result URL open in a browser just by using that index. There's no configuration file, because aliases do the exact same job for this utility. And it supports sequential searches in a single instance, which is lowkey the best part. โจ
๐ธ Features ๐ธ
- Fast and clean; custom color ๐จ
- Designed for maximum readability at minimum space ๐
- Instant answers (supported by DDG html version) โก
- Custom number of results per page
- Navigation, browser integration ๐
- Search and option completion scripts (Bash, Fish, Zsh) ๐
- DuckDuckGo Bangs (along with completion) โ
- Open the first result in browser (I'm Feeling Ducky) ๐ฆ
- REPL for continuous searches ๐
- Keywords (e.g.
filetype:mime,site:somesite.com) - Limit search by time, specify region, disable safe search
- HTTPS proxy support, optionally disable User Agent
- Do Not Track set by default ๐
- Supports custom url handler script or cmdline utility
- Thoroughly documented, man page with examples ๐
- Minimal dependencies ๐
โจ OPTIONS โจ
-h,--helpโ shows the help text and dips. ๐-n,--num=Nโ show N results per page (default10). N has to be between0and25. and listen,N=0is a whole vibe: it disables fixed paging and just shows the actual number of results fetched per page. ๐-r,--reg=REGโ region-specific search, like'us-en'for US (that's the default btw); go visit https://duckduckgo.com/params to find yours. ๐-C,--nocolorโ disables color output. (sad but valid, sometimes you just want plain ๐ฅฒ)--colors=COLORSโ set your output colors. details live in the COLORS section below, keep scrolling bestie ๐-j,--duckyโ opens the first result in a web browser; it implies--noprompt. Feeling Ducky? ๐ฆโจ-t,--time=SPANโ time-limit your search [d=past day,w=past week,m=past month,y=past year] (default=any time). โณ-w,--site=SITEโ search a site using DuckDuckGo. ๐-x,--expandโ expand URLs instead of showing only the domain name (this is the default, iconic behaviour). ๐-p,--proxy=URIโ tunnel traffic through an HTTP proxy. URI looks like[http[s]://][user:pwd@]host[:port]. The proxy server must support HTTP CONNECT tunneling and must not block port443for the relevant DuckDuckGo hosts. If you don't explicitly hand over a proxy, thehttps_proxyorHTTPS_PROXYenvironment variable (if it's available) gets used instead. ๐--unsafeโ disable safe search. (living dangerously, no cap ๐ซฃ)--nouaโ disable user agent. Results are fetched faster. ๐โ๏ธ--jsonโ output in JSON format; implies--noprompt. ๐ค--gb,--gui-browserโ open a bang directly in a GUI browser. ๐ฅ๏ธ--np,--nopromptโ perform the search and exit; don't prompt for any further interactions. ๐ช--rev,--reverseโ list the entries in reversed order. ๐--url-handler=UTILโ custom script or command-line utility to open urls with. ๐ ๏ธ--show-browser-logsโ do not suppress browser output when opening a result in a browser; that is, connect stdout and stderr of the browser to ddgr's stdout and stderr instead of/dev/null. By default, browser output is suppressed (because certain graphical browsers just be spewing messages to console) โ unless theBROWSERenvironment variable is a known text-based browser:elinks,links,lynx,w3morwww-browser. ๐ฃ๏ธ-v,--versionโ show the version number and exit. ๐ข-d,--debugโ enable debugging. ๐
โจ OMNIPROMPT KEYS โจ
n,p,fโ fetch the next, previous or first set of search results. โฎ๏ธโญ๏ธindexโ open the result corresponding to index in the browser. ๐o [index|range|a ...]โ open space-separated result indices, numeric ranges, or all indices (if'a'is specified) in the browser. ๐ซถO [index|range|a ...]โ works similar to key'o', but it tries to ignore text-based browsers (even ifBROWSERis set) and open links in a GUI browser instead. ๐ฅ๏ธd keywordsโ initiate a new DuckDuckGo search for keywords with the original options. You use this key to search omniprompt keys (including itself!) and indices. iykyk ๐xโ toggle url expansion. ๐c indexโ copy url to clipboard. ๐q,^D, double Enter โ exit ddgr. bye bestie ๐?โ show omniprompt help. โ*โ any other string initiates a new search with the original options. ๐
โจ COLORS โจ
ddgr lets you customize the color scheme via a six-letter string, which is giving major BSD LSCOLORS energy. Those six letters represent the colors of:
- indices
- titles
- URLs
- metadata/publishing info
- abstracts
- prompts
respectively. (in that exact order, don't mix them up ๐)
You pass that six-letter string in either as the argument to the --colors option, or as the value of the environment variable DDGR_COLORS. โจ
Here's the menu of colors/styles, no tables needed, we're doing bullets because we're cute like that:
aโ blackbโ redcโ greendโ yelloweโ bluefโ magentagโ cyanhโ whiteiโ bright blackjโ bright redkโ bright greenlโ bright yellowmโ bright bluenโ bright magentaoโ bright cyanpโ bright whiteA-Hโ bold version of the lowercase-letter colorI-Pโ bold version of the lowercase-letter bright colorxโ normalXโ boldyโ reverse videoYโ bold reverse video
The default colors string is oCdgxy, which stands for:
- bright cyan indices
- bold green titles
- yellow URLs
- cyan metadata/publishing info
- normal abstracts
- reverse video prompts
Now, some tea you need to know โ:
- Bright colors (implemented as
\x1b[90m-\x1b[97m) may not be available in all color-capable terminal emulators; - Some terminal emulators draw bold text in bright colors instead;
- Some terminal emulators only distinguish between bold and bright colors via a default-off switch.
Please consult the manual of your terminal emulator as well as https://en.wikipedia.org/wiki/ANSI_escape_code for details. ๐ง
โจ ENVIRONMENT โจ
BROWSERโ overrides the default browser. Ref: http://docs.python.org/library/webbrowser.htmlDDGR_COLORSโ refer to the COLORS section. ๐จDISABLE_PROMPT_COLORโ force a plain omniprompt if you're facing issues with colors at the prompt. ๐HTTPS_PROXY,https_proxyโ refer to the--proxyoption. ๐
โจ EXAMPLES โจ
- DuckDuckGo hello world:
ddgr hello world
- I'm Feeling Ducky search:
ddgr -j lucky ducks
- DuckDuckGo Bang search 'hello world' in Wikipedia:
ddgr !w hello world
ddgr \!w hello world // bash-specific, need to escape ! on bash
Bangs work at the omniprompt too. To look up bangs, visit https://duckduckgo.com/bang?#bangs-list. โ
- Bang alias to fire from the cmdline, open results in a GUI browser and exit:
alias bang='ddgr --gb --np'
bang !w hello world
bang \!w hello world // bash-specific, need to escape ! on bash
- Website specific search:
ddgr -w amazon.com digital camera
Site specific search continues at omniprompt. ๐๏ธ
- Search for a specific file type:
ddgr instrumental filetype:mp3
- Fetch results on IPL cricket from India in English:
ddgr -r in-en IPL cricket
To find your region parameter token visit https://duckduckgo.com/params. ๐
- Search quoted text:
ddgr it\'s a \"beautiful world\" in spring
- Show complete urls in search results (instead of only domain name):
ddgr -x ddgr
- Use a custom color scheme, e.g., one warm color scheme designed for Solarized Dark:
ddgr --colors bjdxxy hello world
DDGR_COLORS=bjdxxy ddgr hello world
- Tunnel traffic through an HTTPS proxy, e.g., a local Privoxy instance listening on port 8118:
ddgr --proxy localhost:8118 hello world
By default the environment variable https_proxy (or HTTPS_PROXY) is used, if defined. ๐
- Look up
n,p,o,O,q,dkeywords or a result index at the omniprompt: as the omniprompt recognizes these keys or index strings as commands, you need to prefix them withd, e.g.,
d n
d d keywords
d 1
โจ AUTHOR โจ
Arun Prakash Jana <engineerarun@gmail.com> ๐
โจ HOME โจ
https://github.com/jarun/ddgr ๐
โจ REPORTING BUGS โจ
https://github.com/jarun/ddgr/issues ๐ (be nice, they're doing great)
โจ LICENSE โจ
Copyright ยฉ 2016-2024 Arun Prakash Jana <engineerarun@gmail.com>
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>. This is free software: you are free to change and redistribute it. There is NO WARRANTY, to the extent permitted by law.
fr fr, that's a real "no warranty" โ like, to the extent permitted by law, none. bestie said it, not me. ๐
and that's the whole page, bestie ๐ this manual is Version 2.2, dated 29 Dec 2023, and it goes out to you from the User Commands section of the man pages as ddgr(1). now go search something, you're gonna slay ๐ฆ๐ โจ
๐ฆ where this page comes from
- arch rolling: ddgr 2.2-2 ยท GPL3
- debian trixie: ddgr 2.2-1 ยท GPL-3.0-or-later
- epel 10: ddgr 2.2-1.el10_0 ยท GPL-3.0-or-later
- epel 9: ddgr 2.2-1.el9 ยท GPL-3.0-or-later
- fedora 43: ddgr 2.2-2.fc43 ยท GPL-3.0-or-later
- fedora 44: ddgr 2.2-4.fc44 ยท GPL-3.0-or-later
- nixos 26.05: ddgr 2.2
- nixpkgs unstable: ddgr 2.2
- opensuse-leap 16.0: ddgr 2.2-bp160.1.9 ยท GPL-3.0-only
- ubuntu noble: ddgr 2.2-1 ยท GPL-3.0-or-later
- ubuntu resolute: ddgr 2.2-1build1 ยท GPL-3.0-or-later
- ubuntu stonking: ddgr 2.2-1build1 ยท GPL-3.0-or-later
- ๐ girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms