Skip to content
Back to skills

Huggingface Tool Builder

ASecurity

Build reusable command-line scripts and utilities for the Hugging Face API with support for chaining, piping, and automation.

  • 7 stars
  • 0 votes
  • 0 copies
  • 6 views
  • Added September 3, 2026
toolstypescriptpythonshellbashapi

Works with

  • cli
  • api

Security analysis

A100/100

Pro scans all 2 files and shows the line behind each finding

Scanned September 3, 2026

npx -y skills add mediar-ai/skillhubz --skill huggingface-tool-builder --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Huggingface Tool Builder?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Huggingface Tool Builder
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/mediar-ai-huggingface-tool-builder/badge)](https://www.skillsdirectory.com/skills/mediar-ai-huggingface-tool-builder)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
# Hugging Face Tool Builder

Build reusable command-line scripts and utilities for the Hugging Face API with support for chaining, piping, and automation.

## Prerequisites

- HF_TOKEN environment variable for API access
- Shell (bash), Python, or TypeScript for scripts

## Instructions

### Script Rules

1. Scripts must support `--help` argument
2. Use `HF_TOKEN` environment variable for authentication
3. Prefer shell scripts; use Python/TypeScript for complexity
4. Test non-destructive scripts before delivery
5. Share usage examples

### API Endpoints

```
/api/models      - Model search and metadata
/api/datasets    - Dataset search and metadata
/api/spaces      - Space search and metadata
/api/collections - Collection management
/api/daily_papers - Daily paper updates
/api/trending    - Trending content
/api/whoami-v2   - User information
```

### Example: Query API

```bash
# Get all endpoints
curl -s "https://huggingface.co/.well-known/openapi.json" | jq '.paths | keys'

# Search models
curl -H "Authorization: Bearer ${HF_TOKEN}" \
  "https://huggingface.co/api/models?search=llama&limit=5"

# Get model details
curl -H "Authorization: Bearer ${HF_TOKEN}" \
  "https://huggingface.co/api/models/meta-llama/Llama-2-7b"
```

### Composable Pipelines

```bash
# Get top 10 models by downloads
./baseline_hf_api.sh 50 | \
  jq '[.[] | {id, downloads}] | sort_by(.downloads) | reverse | .[:10]'

# Enrich model IDs with metadata
printf '%s\n' model1 model2 | ./hf_enrich_models.sh | jq -s '.'

# Extract model card frontmatter
printf '%s\n' meta-llama/Llama-2-7b | ./hf_model_card_frontmatter.sh
```

### HF CLI Commands

```bash
hf download <repo> <file>     # Download files
hf upload <repo> <file>       # Upload files
hf repo create <name>         # Create repository
hf repo-files list <repo>     # List repo files
hf jobs ps                    # List jobs
```

### Reference Scripts

- `baseline_hf_api.sh` - Simple API query (bash)
- `baseline_hf_api.py` - Simple API query (Python)
- `hf_enrich_models.sh` - Enrich model IDs with metadata
- `hf_model_papers_auth.sh` - Fetch papers with auth
- `find_models_by_paper.sh` - Search models by paper

## Notes

- Do not read openapi.json directly (too large) - use jq to extract
- Always use HF_TOKEN for higher rate limits
- Prefer streaming JSON (NDJSON) for large outputs

Source: huggingface/skills

Files in this skill

  • manifest.json366 B
  • skill.md2.3 KB

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

View all in tools →

Comments

Loading comments…

Newsletter

Get the weekly list of safe new skills, and the ones we pulled.