Spaces:
Paused
Paused
Download sandbox/git-credential-huggingface from Mike0021/pi-web-runtime: direct link, hf CLI and curl.
- Browser
- Download file 521 Bytes
-
https://huggingface.co/spaces/Mike0021/pi-web-runtime/resolve/main/sandbox/git-credential-huggingface
- Command line
-
hf download hf://spaces/Mike0021/pi-web-runtime/sandbox/git-credential-huggingface
-
curl -L -o git-credential-huggingface https://huggingface.co/spaces/Mike0021/pi-web-runtime/resolve/main/sandbox/git-credential-huggingface
521 Bytes
| # Git credential helper for huggingface.co (set in /etc/gitconfig): answers with the token | |
| # the Space lent to the agent through Sign in with Hugging Face, if there is one, so the | |
| # token never ends up in a remote URL or in .git/config. | |
| cat >/dev/null | |
| [ "$1" = "get" ] || exit 0 | |
| dir="${HF_HOME:-$HOME/.cache/huggingface}" | |
| [ -s "$dir/token" ] || exit 0 | |
| user=$(sed -n 's/.*"user": *"\([^"]*\)".*/\1/p' "$dir/hfpi-identity.json" 2>/dev/null) | |
| printf 'username=%s\npassword=%s\n' "${user:-hf}" "$(cat "$dir/token")" | |