Builds reusable command-line scripts and utilities around the Hugging Face API and `hf` CLI - composable, pipeable tools that fetch, enrich, and process Hub data with proper auth.
---
name: huggingface-tool-builder
description: Create reusable CLI scripts and utilities that use the Hugging Face API, especially when chaining/combining API calls or automating repeated tasks. The skill builds composable tools that fetch, enrich, or process Hub data.
---
# Hugging Face API Tool Builder
Builds reusable command-line scripts for the Hugging Face API, favoring chaining, piping, and intermediate processing.
## Workflow
1. Investigate the API shape first - endpoints live at `https://huggingface.co/api/{models,datasets,spaces,collections,daily_papers,trending,...}`; query the OpenAPI spec with `jq` (never read it whole).
2. Authenticate with the `HF_TOKEN` env var as a bearer header: `curl -H "Authorization: Bearer ${HF_TOKEN}" ...` for higher limits and gated access.
3. Prefer shell scripts (Python or TSX only when complexity warrants); each script must support `--help` and emit shell-friendly JSON/NDJSON for piping.
4. Compose tools - e.g. fetch trending models, pipe IDs into an enrichment script, then `jq` to sort by downloads.
5. Use the `hf` CLI for repo content and infrastructure; test non-destructive scripts and share usage examples before handoff.
Full skill & source: https://github.com/huggingface/skills/tree/ea9a24f38a98baf2430dab3bcb31a89753ae9e6d/skills/huggingface-tool-builder