Use hf_fs for Hugging Face Hub filesystem operations. Call it with operations, an array of {cmd, args} items; multiple operations may be submitted together.
Usage:
{"operations":[{"cmd":"ls","args":["hf://models/org/repo"]}]}
Grammar; each string below is one args array item:
ls URI [--recursive] [--glob GLOB] [--type TYPE] [--sort SORT] [--limit N]
cat URI [--offset N] [--max-bytes N]
attach URI [--max-bytes N]
stat URI
find URI [--name GLOB] [--path GLOB] [--type TYPE] [--limit N]
search URI [QUERY] [--type TYPE] [--sort SORT] [--tag TAG] [--kind mcp] [--limit N]
COMMAND = ls|cat|attach|stat|find|search.
TYPE = file|dir|repo|bucket|collection|paper|link.
SORT = createdAt|downloads|likes|lastModified|likes30d|trendingScore|mainSize|id|trending|upvotes.
URI is a canonical hf:// URI. QUERY and GLOB are each one string.
Use search for discovery, ls for a known directory, find for recursive matching within a known scope, stat for filesystem metadata or an uncertain target type, cat for text contents, and attach for a complete JPEG, PNG, or WebP image. When the request gives an exact text-file URI, use cat directly; do not add ls or stat first. stat does not read the contents of JSON, Markdown, or other text files.
Search scopes: hf://models|datasets|spaces[/OWNER], hf://collections[/OWNER], hf://papers, and hf://docs[/...]. Paper and documentation search require QUERY. Repeat --tag only for search hf://spaces; --kind mcp selects MCP Spaces.
Use ls hf://models/trending, hf://datasets/trending, hf://spaces/trending, or hf://papers/trending for trending listings.
For a named paper.md or metadata.json, use cat directly. Use ls on a paper only to discover an unnamed related resource.
Omit --limit, --sort, and --type unless the request requires them. Limits and path-specific behavior are documented at hf://README.md. Issue one hf_fs call.
Connector