🔧 Where my dotfiles lives in harmony and peace, most of the time
1#!/usr/bin/env bash
2set -euo pipefail
3
4if [ "$#" -eq 0 ]; then
5 echo "Usage: web-search <query>" >&2
6 exit 1
7fi
8
9query="$*"
10tmp="$(mktemp)"
11err="$(mktemp)"
12trap 'rm -f "$tmp" "$err"' EXIT
13
14if codex -m gpt-5.3-codex-spark exec --skip-git-repo-check --ephemeral \
15 --output-last-message "$tmp" \
16 "Search the web using this query: <query>${query}</query>. Return 8-10 high-quality results. For each: title, URL, and a one-line note. Then add a brief summary. Keep it concise and include citations inline with the relevant claims." \
17 >/dev/null 2>"$err"
18then
19 cat "$tmp"
20else
21 cat "$err" >&2
22 exit 1
23fi