Detect File Type - Local for Openclaw

A local, privacy-first AI skill for identifying file types and MIME information without internet access.

pgeraghty
v0.2.0
Feb 27, 2026
1
1k
0

Install & Download

1. ClawHub CLI

The fastest way to install a skill directly from the registry.

npx clawhub@latest install detect-file-type-local

2. Manual Installation

Copy the skill folder to one of these locations

Global
~/.openclaw/skills/
Workspace
<project>/skills/

Priority: Workspace > Local > Bundled

3. Prompt Installation

Copy this prompt to OpenClaw to install it automatically.

Help me install detect-file-type-local using Clawhub. If Clawhub is not installed, install it first (npm i -g clawhub).

Prefer to download?

Get the raw skill files in a ZIP archive.

What is Detect File Type - Local?

Detect File Type - Local provides a robust, offline solution for file identification within the Openclaw Skills directory. By leveraging the Google Magika machine learning model and ONNX Runtime, it performs deep content analysis on-device to classify over 214 different file types. Unlike traditional extension-based identification, this tool examines actual byte patterns to ensure high accuracy even when files are mislabeled, hidden, or obfuscated.

This skill is designed for developers and security researchers who prioritize data privacy. Because all inference happens locally, no sensitive file data ever leaves your machine. Integrating this into your local Openclaw Skills environment enables reliable, scalable, and secure file processing without the need for external API keys or constant network connectivity.

Detect File Type - Local Use Cases

  • Identify unknown files by their actual content rather than just the file extension.
  • Detect masquerading files and suspicious polyglot-style payloads used in security threats.
  • Verify MIME types locally before processing uploads or downloads in a pipeline.
  • Triage large directories of files by type and group during data migration or cleanup.
  • Ensure data privacy by performing all file analysis on the local machine.

How Detect File Type - Local Works

  1. The tool reads the file bytes or stdin stream directly on the local filesystem.
  2. It passes the content to an embedded Google Magika ML model running via ONNX Runtime.
  3. The model analyzes the byte signatures to determine the file category, MIME type, and confidence score.
  4. The results are output as structured JSON, a human-readable summary, or a bare MIME string based on user preference.

Detect File Type - Local Setup

Install the package directly via pip to start using it within your Openclaw Skills workflow:

pip install detect-file-type-local

To install from source for development purposes:

pip install -e /path/to/detect-file-type-skill

Detect File Type - Local Data Schema & Taxonomy

The skill returns structured data for every file processed. When multiple files are scanned, the output is an array of objects.

Field Type Description
path string The input file path or - for stdin.
label string Detected file type label (e.g., pdf, png, python).
mime_type string The official MIME type (e.g., application/pdf).
score float Confidence score ranging from 0.0 to 1.0.
group string Broad category (e.g., document, image, code).
is_text bool Indicates if the file is text-based content.

Detect File Type - Local Advanced Features

  • Recursive directory scanning to process entire folder trees in one command.
  • Support for stdin processing with high-performance 'head' mode for large streams.
  • Multiple output formats including JSON (default), human-readable text, and bare MIME types.
  • Precise confidence scoring to filter out low-certainty detections.
  • Identification of 214+ file types including complex polyglots and nested formats.

SKILL.md


Loading

Related Openclaw Skills

METADATA

Github Stars: 0
forks: 0

Featured*