1DDGR(1)                          User Commands                         DDGR(1)
2
3
4

NAME

6       ddgr - DuckDuckGo from the terminal
7

SYNOPSIS

9       ddgr [OPTIONS] [KEYWORD [KEYWORD ...]]
10

DESCRIPTION

12       ddgr  is  a command-line tool to search DuckDuckGo (html version). ddgr
13       shows the title, URL and text context  for  each  result.  Results  are
14       fetched in pages. Keyboard shortcuts are available for page navigation.
15       Results are indexed and a result URL can be opened in a  browser  using
16       the  index  number. There is no configuration file as aliases serve the
17       same purpose for this utility. Supports sequential searches in a single
18       instance.
19
20       Features
21
22         * Fast and clean; custom color
23         * Designed for maximum readability at minimum space
24         * Instant answers (supported by DDG html version)
25         * Custom number of results per page
26         * Navigation, browser integration
27         * Search and option completion scripts (Bash, Fish, Zsh)
28         * DuckDuckGo Bangs (along with completion)
29         * Open the first result in browser (I'm Feeling Ducky)
30         * REPL for continuous searches
31         * Keywords (e.g. `filetype:mime`, `site:somesite.com`)
32         * Limit search by time, specify region, disable safe search
33         * HTTPS proxy support, optionally disable User Agent
34         * Do Not Track set by default
35         * Supports custom url handler script or cmdline utility
36         * Thoroughly documented, man page with examples
37         * Minimal dependencies
38

OPTIONS

40       -h, --help
41              Show help text and exit.
42
43       -n, --num=N
44              Show  N  results  per page (default 10). N must be between 0 and
45              25. N=0 disables fixed paging and shows actual number of results
46              fetched per page.
47
48       -r, --reg=REG
49              Region-specific  search  e.g.  'us-en'  for  US (default); visit
50              https://duckduckgo.com/params.
51
52       -C, --nocolor
53              Disable color output.
54
55       --colors=COLORS
56              Set output colors. Refer to the COLORS  section  below  for  de‐
57              tails.
58
59       -j, --ducky
60              Open  the  first  result  in  a web browser; implies --noprompt.
61              Feeling Ducky?
62
63       -t, --time=SPAN
64              Time limit search [d=past day, w=past week, m=past month, y=past
65              year] (default=any time).
66
67       -w, --site=SITE
68              Search a site using DuckDuckGo.
69
70       -x, --expand
71              Expand URLs instead of showing only the domain name (default).
72
73       -p, --proxy=URI
74              Tunnel  traffic  through  an  HTTP  proxy.  URI  is  of the form
75              [http[s]://][user:pwd@]host[:port]. The proxy server  must  sup‐
76              port  HTTP CONNECT tunneling and must not block port 443 for the
77              relevant DuckDuckGo hosts. If a proxy is not  explicitly  given,
78              the  https_proxy  or HTTPS_PROXY environment variable (if avail‐
79              able) is used instead.
80
81       --unsafe
82              Disable safe search.
83
84       --noua Disable user agent. Results are fetched faster.
85
86       --json Output in JSON format; implies --noprompt.
87
88       --gb, --gui-browser
89              Open a bang directly in a GUI browser.
90
91       --np, --noprompt
92              Perform search and exit; do not prompt for further interactions.
93
94       --rev, --reverse
95              List the entries in reversed order.
96
97       --url-handler=UTIL
98              Custom script or command-line utility to open urls with.
99
100       --show-browser-logs
101              Do not suppress browser output when opening result  in  browser;
102              that is, connect stdout and stderr of the browser to ddgr's std‐
103              out and stderr instead of /dev/null. By default, browser  output
104              is  suppressed  (due  to certain graphical browsers spewing mes‐
105              sages to console) unless the BROWSER environment variable  is  a
106              known  text-based  browser:  elinks,  links,  lynx,  w3m or www-
107              browser.
108
109       -v, --version
110              Show version number and exit.
111
112       -d, --debug
113              Enable debugging.
114

OMNIPROMPT KEYS

116       n, p, f
117              Fetch the next, previous or first set of search results.
118
119       index  Open the result corresponding to index in browser.
120
121       o [index|range|a ...]
122              Open space-separated result indices, numeric ranges or  all  in‐
123              dices, if 'a' is specified, in the browser.
124
125       O [index|range|a ...]
126              Works  similar  to  key  'o',  but  tries  to  ignore text-based
127              browsers (even if BROWSER is  set)  and  open  links  in  a  GUI
128              browser.
129
130       d keywords
131              Initiate  a new DuckDuckGo search for keywords with original op‐
132              tions. This key should be used to search  omniprompt  keys  (in‐
133              cluding itself) and indices.
134
135       x      Toggle url expansion.
136
137       c index
138              Copy url to clipboard.
139
140       q, ^D, double Enter
141              Exit ddgr.
142
143       ?      Show omniprompt help.
144
145       *      Any other string initiates a new search with original options.
146

COLORS

148       ddgr  allows you to customize the color scheme via a six-letter string,
149       reminiscent of BSD LSCOLORS. The six letters represent the colors of
150
151       - indices
152       - titles
153       - URLs
154       - metadata/publishing info
155       - abstracts
156       - prompts
157
158       respectively. The six-letter string is passed in either as the argument
159       to  the  --colors  option,  or as the value of the environment variable
160       DDGR_COLORS.
161
162       We offer the following colors/styles:
163
164         ┌───────┬───────────────────────────────────────────────────┐
165         │Letter │ Color/Style                                       │
166         ├───────├───────────────────────────────────────────────────┤
167         │a      │ black                                             │
168         │b      │ red                                               │
169         │c      │ green                                             │
170         │d      │ yellow                                            │
171         │e      │ blue                                              │
172         │f      │ magenta                                           │
173         │g      │ cyan                                              │
174         │h      │ white                                             │
175         │i      │ bright black                                      │
176         │j      │ bright red                                        │
177         │k      │ bright green                                      │
178         │l      │ bright yellow                                     │
179         │m      │ bright blue                                       │
180         │n      │ bright magenta                                    │
181         │o      │ bright cyan                                       │
182         │p      │ bright white                                      │
183         │A-H    │ bold version of the lowercase-letter color        │
184         │I-P    │ bold version of the lowercase-letter bright color │
185         │x      │ normal                                            │
186         │X      │ bold                                              │
187         │y      │ reverse video                                     │
188         │Y      │ bold reverse video                                │
189         └───────┴───────────────────────────────────────────────────┘
190
191       The default colors string is oCdgxy, which stands for
192
193       - bright cyan indices
194       - bold green titles
195       - yellow URLs
196       - cyan metadata/publishing info
197       - normal abstracts
198       - reverse video prompts
199
200       Note that
201
202       - Bright colors (implemented as \x1b[90m - \x1b[97m) may not be  avail‐
203         able in all color-capable terminal emulators;
204
205       - Some terminal emulators draw bold text in bright colors instead;
206
207       - Some terminal emulators only distinguish between bold and bright col‐
208         ors via a default-off switch.
209
210       Please consult  the  manual  of  your  terminal  emulator  as  well  as
211       https://en.wikipedia.org/wiki/ANSI_escape_code for details.
212

ENVIRONMENT

214       BROWSER
215              Overrides  the  default browser. Ref: http://docs.python.org/li
216              brary/webbrowser.html
217
218       DDGR_COLORS
219              Refer to the COLORS section.
220
221       DISABLE_PROMPT_COLOR
222              Force a plain omniprompt if you are facing issues with colors at
223              the prompt.
224
225       HTTPS_PROXY, https_proxy
226              Refer to the --proxy option.
227

EXAMPLES

229       1.  DuckDuckGo hello world:
230
231              ddgr hello world
232
233       2.  I'm Feeling Ducky search:
234
235              ddgr -j lucky ducks
236
237       3.  DuckDuckGo Bang search 'hello world' in Wikipedia:
238
239              ddgr !w hello world
240              ddgr \!w hello world // bash-specific, need to escape ! on bash
241
242           Bangs  work  at  the  omniprompt  too.  To  look  up  bangs,  visit
243           https://duckduckgo.com/bang?#bangs-list.
244
245       4.  Bang alias to fire from the cmdline, open results in a GUI  browser
246           and exit:
247
248              alias bang='ddgr --gb --np'
249
250              bang !w hello world
251              bang \!w hello world // bash-specific, need to escape ! on bash
252
253       5.  Website specific search:
254
255              ddgr -w amazon.com digital camera
256
257           Site specific search continues at omniprompt.
258
259       6.  Search for a specific file type:
260
261              ddgr instrumental filetype:mp3
262
263       7.  Fetch results on IPL cricket from India in English:
264
265              ddgr -r in-en IPL cricket
266
267           To   find   your   region   parameter   token  visit  https://duck
268           duckgo.com/params.
269
270       8.  Search quoted text:
271
272              ddgr it\'s a \"beautiful world\" in spring
273
274       9.  Show complete urls in search results (instead of only domain name):
275
276              ddgr -x ddgr
277
278       10. Use a custom color scheme, e.g., one warm color scheme designed for
279           Solarized Dark:
280
281              ddgr --colors bjdxxy hello world
282
283              DDGR_COLORS=bjdxxy ddgr hello world
284
285       11. Tunnel  traffic  through  an HTTPS proxy, e.g., a local Privoxy in‐
286           stance listening on port 8118:
287
288              ddgr --proxy localhost:8118 hello world
289
290           By default the environment variable https_proxy (or HTTPS_PROXY) is
291           used, if defined.
292
293       12. Look  up  n,  p,  o,  O, q, d keywords or a result index at the om‐
294           niprompt: as the omniprompt recognizes these keys or index  strings
295           as commands, you need to prefix them with d, e.g.,
296
297              d n
298              d d keywords
299              d 1
300

AUTHOR

302       Arun Prakash Jana <engineerarun@gmail.com>
303

HOME

305       https://github.com/jarun/ddgr
306

REPORTING BUGS

308       https://github.com/jarun/ddgr/issues
309

LICENSE

311       Copyright © 2016-2022 Arun Prakash Jana <engineerarun@gmail.com>
312
313       License   GPLv3+:  GNU  GPL  version  3  or  later  <http://gnu.org/li
314       censes/gpl.html>.
315       This is free software: you are free  to  change  and  redistribute  it.
316       There is NO WARRANTY, to the extent permitted by law.
317
318
319
320Version 2.1                       22 Oct 2022                          DDGR(1)
Impressum