Agent Skillsgradio-app/gradio › hf-gradio

hf-gradio

GitHub

通过 CLI 工具与 Hugging Face Spaces 中的 Gradio 应用交互,支持查询接口信息和生成预测结果。

.agents/skills/hf-gradio/SKILL.md gradio-app/gradio

Trigger Scenarios

用户要求调用 Hugging Face Space 上的 Gradio 应用进行预测 用户需要获取 Gradio 应用的端点参数和返回格式信息

Install

npx skills add gradio-app/gradio --skill hf-gradio -g -y
More Options

Non-standard path

npx skills add https://github.com/gradio-app/gradio/tree/main/.agents/skills/hf-gradio -g -y

Use without installing

npx skills use gradio-app/gradio@hf-gradio

指定 Agent (Claude Code)

npx skills add gradio-app/gradio --skill hf-gradio -a claude-code -g -y

安装 repo 全部 skill

npx skills add gradio-app/gradio --all -g -y

预览 repo 内 skill

npx skills add gradio-app/gradio --list

SKILL.md

Frontmatter
{
    "name": "hf-gradio",
    "description": "Use Gradio applications via API. Use when the user asks for to generate a prediction from a Gradio app on Hugging Face spaces or public URL. For example, \"Generate an image using black-forest-labs\/FLUX.2-dev\"."
}

hf-gradio CLI Skill

The hf-gradio CLI gradio CLI includes info and predict commands for interacting with Gradio apps programmatically.

Step 1 - Verify installation

Verify that either hf-gradio or gradio are installed in the current virtual environment.

If the hf CLI app is installed. The hf-gradio extension can be installed via

hf extensions install gradio-app/hf-gradio

Step 2 - Use info to discover endpoints and payload format

gradio info <space_id_or_url>
hf-gradio info <space_id_or_url>
hf gradio info <space_id_or_url>

Returns a JSON payload describing all endpoints, their parameters (with types and defaults), and return values.

gradio info gradio/calculator
#    {
#   "/predict": {
#     "parameters": [
#       {"name": "num1", "required": true, "default": null, "type": {"type": "number"}},
#       {"name": "operation", "required": true, "default": null, "type": {"enum": ["add", "subtract", "multiply", "divide"], "type": "string"}},
#       {"name": "num2", "required": true, "default": null, "type": {"type": "number"}}
#     ],
#     "returns": [{"name": "output", "type": {"type": "number"}}],
#     "description": ""
#   }
# }

File-type parameters show "type": "filepath" with instructions to include "meta": {"_type": "gradio.FileData"} — this signals the file will be uploaded to the remote server.

Step 3 - Use predict to generate the prediction

gradio predict <space_id_or_url> <endpoint> <json_payload>
hf-gradio predict <space_id_or_url> <endpoint> <json_payload>
hf gradio predict <space_id_or_url> <endpoint> <json_payload>

Returns a JSON object with named output keys.

# Simple numeric prediction
gradio predict gradio/calculator /predict '{"num1": 5, "operation": "multiply", "num2": 3}'
# {"output": 15}

# Image generation
gradio predict black-forest-labs/FLUX.2-dev /infer '{"prompt": "A majestic dragon"}'
# {"Result": "/tmp/gradio/.../image.webp", "Seed": 1117868604}

# File upload (must include meta key)
gradio predict gradio/image_mod /predict '{"image": {"path": "/path/to/image.png", "meta": {"_type": "gradio.FileData"}}}'
# {"output": "/tmp/gradio/.../output.png"}

Both commands accept --token for accessing private Spaces.

Version History

  • a535e77 Current 2026-08-20 18:50

Same Skill Collection

.agents/skills/frontend-unit-testing/SKILL.md
.agents/skills/gradio-themes/SKILL.md
.agents/skills/gradio/SKILL.md

Metadata

Files
0
Version
2ae6f97
Hash
2be3bc11
Indexed
2026-08-20 18:50

trang chủ - Wiki
Copyright © 2011-2026 iteam. Current version is 2.155.2. UTC+08:00, 2026-09-01 20:18
浙ICP备14020137号-1 $bản đồ khách truy cập$