Skip to main content
Fetcher plugins retrieve file metadata asynchronously and in batches. They’re perfect for tasks like detecting MIME types, reading Git status, or extracting custom file properties.

What Are Fetchers?

Fetchers run in the background to collect file metadata without blocking the UI. Common uses:
  • MIME type detection - Identify file types
  • Git status - Show version control info
  • Image metadata - Extract dimensions, format, EXIF
  • Audio tags - Read ID3 tags from music files
  • Custom properties - Any file-specific data
Yazi’s built-in MIME fetchers are essential examples.

Fetcher Structure

The Job Object

Example: MIME Type Fetcher

Yazi’s local MIME fetcher using the file command:
Configure in yazi.toml:

Example: Directory MIME Fetcher

Mark directories with a special MIME type:

Example: Remote MIME Fetcher

Detect MIME types for remote files:

Example: Git Status Fetcher

Show Git status for files:

Updating Metadata

Update MIME Types

Update Custom Metadata

Batch Processing

Process files efficiently in batches:

Throttling Updates

Avoid overwhelming the UI:

Streaming Output

Read command output line by line:

Error Handling

Configuration

Configure fetchers in yazi.toml:

Priority Levels

  • high - Essential, run first
  • normal - Standard priority
  • low - Nice-to-have, run last

Best Practices

Call external tools once for multiple files:
Don’t emit events too frequently:
Set placeholder values when tools are unavailable:
Don’t block indefinitely:
Always kill spawned processes:

Next Steps

Previewers

Create custom file previewers

Functional Plugins

Add new commands