Skip to content

Instantly share code, notes, and snippets.

@giladbarnea
Created January 22, 2026 12:13
Show Gist options
  • Select an option

  • Save giladbarnea/dc7fc01e3a101f8da7ef62354e550c65 to your computer and use it in GitHub Desktop.

Select an option

Save giladbarnea/dc7fc01e3a101f8da7ef62354e550c65 to your computer and use it in GitHub Desktop.
rf | robust-fetch executable
#!/usr/bin/env -S bash
typeset -a args
typeset cache_result=false
while [[ $# -gt 0 ]]; do
case "$1" in
--cache) cache_result=true ;;
*) args+=("$1") ;;
esac
shift
done
if [[ $cache_result = true ]]; then
if command -v cached >/dev/null 2>&1; then
echo "[rf][INFO] Caching invocation" 1>&2
cached ~/.claude/skills/robust-fetch/scripts/robust_fetch.py "${args[@]}"
else
echo "[rf][WARNING] ‘cached’ command not found. Will run the command without caching. Try running this script via ‘FORCE_OMZ=1 /bin/zsh -ic 'rf ...'’. " 1>&2
~/.claude/skills/robust-fetch/scripts/robust_fetch.py "${args[@]}"
fi
else
~/.claude/skills/robust-fetch/scripts/robust_fetch.py "${args[@]}"
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment