aboutsummaryrefslogtreecommitdiffstats
path: root/tools/search_duckduckgo.sh
diff options
context:
space:
mode:
Diffstat (limited to 'tools/search_duckduckgo.sh')
-rwxr-xr-xtools/search_duckduckgo.sh16
1 files changed, 16 insertions, 0 deletions
diff --git a/tools/search_duckduckgo.sh b/tools/search_duckduckgo.sh
new file mode 100755
index 0000000..c5ab565
--- /dev/null
+++ b/tools/search_duckduckgo.sh
@@ -0,0 +1,16 @@
+#!/usr/bin/env bash
+set -e
+
+# @describe Takes in a query string and returns search result from DuckDuckGo.
+# Use it to answer user questions that require dates, facts, real-time information, or news.
+# This ensures accurate and up-to-date answers.
+
+# @meta require-tools ddgr
+# @env DDG_MAX_RESULTS=5 The max results to return.
+# @option --query! The query to search for.
+
+main() {
+ ddgr -n $DDG_MAX_RESULTS --json "$argc_query"
+}
+
+eval "$(argc --argc-eval "$0" "$@")"