aboutsummaryrefslogtreecommitdiffstats
path: root/sh/search_duckduckgo.sh
blob: c5ab565394ae9088c04440afbcbddb4c3a1ae88b (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
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" "$@")"