Files
CrazyClaude/tools/search_arxiv.sh
Eric Coissac 2f1d437723 Squashed '.claude/llm-functions/' content from commit 616d8d8
git-subtree-dir: .claude/llm-functions
git-subtree-split: 616d8d84c5565fdb66d8782ae5ba56d994bfa82a
2026-03-27 09:14:17 +01:00

18 lines
496 B
Bash
Executable File

#!/usr/bin/env bash
set -e
# @describe Search arXiv for a query and return the top papers.
# @option --query! The query to search for.
# @env ARXIV_MAX_RESULTS=3 The max results to return.
# @env LLM_OUTPUT=/dev/stdout The output path
main() {
encoded_query="$(jq -nr --arg q "$argc_query" '$q|@uri')"
url="http://export.arxiv.org/api/query?search_query=all:$encoded_query&max_results=$ARXIV_MAX_RESULTS"
curl -fsSL "$url" >> "$LLM_OUTPUT"
}
eval "$(argc --argc-eval "$0" "$@")"