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. ddgr shows the title,
13       URL and text context for each result. Results  are  fetched  in  pages.
14       Keyboard  shortcuts  are  available  for  page  navigation. Results are
15       indexed and a result URL can be opened in a  browser  using  the  index
16       number.  There  is no configuration file as aliases serve the same pur‐
17       pose 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
57              details.
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       --url-handler=UTIL
95              Custom script or command-line utility to open urls with.
96
97       --show-browser-logs
98              Do not suppress browser output when opening result  in  browser;
99              that is, connect stdout and stderr of the browser to ddgr's std‐
100              out and stderr instead of /dev/null. By default, browser  output
101              is  suppressed  (due  to certain graphical browsers spewing mes‐
102              sages to console) unless the BROWSER environment variable  is  a
103              known  text-based  browser:  elinks,  links,  lynx,  w3m or www-
104              browser.
105
106       -v, --version
107              Show version number and exit.
108
109       -d, --debug
110              Enable debugging.
111

OMNIPROMPT KEYS

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

COLORS

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

ENVIRONMENT

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

EXAMPLES

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

AUTHOR

299       Arun Prakash Jana <engineerarun@gmail.com>
300

HOME

302       https://github.com/jarun/ddgr
303

REPORTING BUGS

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

LICENSE

308       Copyright © 2016-2020 Arun Prakash Jana <engineerarun@gmail.com>
309
310       License      GPLv3+:     GNU     GPL     version     3     or     later
311       <http://gnu.org/licenses/gpl.html>.
312       This is free software: you are free  to  change  and  redistribute  it.
313       There is NO WARRANTY, to the extent permitted by law.
314
315
316
317Version 1.9                       21 Jul 2020                          DDGR(1)
Impressum