# Send Detect File Type - Local to your agent
Hand the extracted package to your coding agent with a concrete install brief instead of figuring it out manually.
## Fast path
- Download the package from Yavira.
- Extract it into a folder your agent can access.
- Paste one of the prompts below and point your agent at the extracted folder.
## Suggested prompts
### New install

```text
I downloaded a skill package from Yavira. Read SKILL.md from the extracted folder and install it by following the included instructions. Then review README.md for any prerequisites, environment setup, or post-install checks. Tell me what you changed and call out any manual steps you could not complete.
```
### Upgrade existing

```text
I downloaded an updated skill package from Yavira. Read SKILL.md from the extracted folder, compare it with my current installation, and upgrade it while preserving any custom configuration unless the package docs explicitly say otherwise. Then review README.md for any prerequisites, environment setup, or post-install checks. Summarize what changed and any follow-up checks I should run.
```
## Machine-readable fields
```json
{
  "schemaVersion": "1.0",
  "item": {
    "slug": "detect-file-type-local",
    "name": "Detect File Type - Local",
    "source": "tencent",
    "type": "skill",
    "category": "开发工具",
    "sourceUrl": "https://clawhub.ai/pgeraghty/detect-file-type-local",
    "canonicalUrl": "https://clawhub.ai/pgeraghty/detect-file-type-local",
    "targetPlatform": "OpenClaw"
  },
  "install": {
    "downloadUrl": "/downloads/detect-file-type-local",
    "sourceDownloadUrl": "https://wry-manatee-359.convex.site/api/v1/download?slug=detect-file-type-local",
    "sourcePlatform": "tencent",
    "targetPlatform": "OpenClaw",
    "packageFormat": "ZIP package",
    "primaryDoc": "SKILL.md",
    "includedAssets": [
      "README.md",
      "SECURITY.md",
      "SKILL.md",
      "THIRD_PARTY_LICENSES.md",
      "detect_file_type/__init__.py",
      "detect_file_type/__main__.py"
    ],
    "downloadMode": "redirect",
    "sourceHealth": {
      "source": "tencent",
      "slug": "detect-file-type-local",
      "status": "healthy",
      "reason": "direct_download_ok",
      "recommendedAction": "download",
      "checkedAt": "2026-05-02T12:06:01.680Z",
      "expiresAt": "2026-05-09T12:06:01.680Z",
      "httpStatus": 200,
      "finalUrl": "https://wry-manatee-359.convex.site/api/v1/download?slug=detect-file-type-local",
      "contentType": "application/zip",
      "probeMethod": "head",
      "details": {
        "probeUrl": "https://wry-manatee-359.convex.site/api/v1/download?slug=detect-file-type-local",
        "contentDisposition": "attachment; filename=\"detect-file-type-local-0.2.0.zip\"",
        "redirectLocation": null,
        "bodySnippet": null,
        "slug": "detect-file-type-local"
      },
      "scope": "item",
      "summary": "Item download looks usable.",
      "detail": "Yavira can redirect you to the upstream package for this item.",
      "primaryActionLabel": "Download for OpenClaw",
      "primaryActionHref": "/downloads/detect-file-type-local"
    },
    "validation": {
      "installChecklist": [
        "Use the Yavira download entry.",
        "Review SKILL.md after the package is downloaded.",
        "Confirm the extracted package contains the expected setup assets."
      ],
      "postInstallChecks": [
        "Confirm the extracted package includes the expected docs or setup files.",
        "Validate the skill or prompts are available in your target agent workspace.",
        "Capture any manual follow-up steps the agent could not complete."
      ]
    }
  },
  "links": {
    "detailUrl": "https://openagent3.xyz/skills/detect-file-type-local",
    "downloadUrl": "https://openagent3.xyz/downloads/detect-file-type-local",
    "agentUrl": "https://openagent3.xyz/skills/detect-file-type-local/agent",
    "manifestUrl": "https://openagent3.xyz/skills/detect-file-type-local/agent.json",
    "briefUrl": "https://openagent3.xyz/skills/detect-file-type-local/agent.md"
  }
}
```
## Documentation

### Detect File Type - Local

Local-only, offline file type detection. Uses an embedded ML model (Google Magika) to identify 214 file types by content — no network calls, no API keys, no data leaves the machine. All inference runs on-device via ONNX Runtime.

### When to Use

Identify unknown files by their content (not just extension) — locally, without sending data anywhere
Verify that a file's extension matches its actual content
Check MIME types before processing uploads or downloads
Triage files in a directory by type
Detect extension mismatches and masquerading (e.g., .pdf.exe, .xlsx.lnk)
Flag suspicious polyglot-style payloads (for example PDF/ZIP or PDF/HTA-style chains)
When privacy matters — file bytes never leave the local machine

### Installation

pip install detect-file-type-local

From source:

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

### Single file

detect_file_type path/to/file

### Multiple files

detect_file_type file1.pdf file2.png file3.zip

### Recursive directory scan

detect_file_type --recursive ./uploads/

### From stdin

cat mystery_file | detect_file_type -

# Optional best-effort fast path (head only)
cat mystery_file | detect_file_type --stdin-mode head --stdin-max-bytes 1048576 -

### Output formats

detect_file_type --json file.pdf    # JSON (default)
detect_file_type --human file.pdf   # Human-readable
detect_file_type --mime file.pdf    # Bare MIME type

### Programmatic (Python)

python -m detect_file_type path/to/file

### Output Schema (JSON)

Single file returns an object; multiple files return an array.

{
  "path": "document.pdf",
  "label": "pdf",
  "mime_type": "application/pdf",
  "score": 0.99,
  "group": "document",
  "description": "PDF document",
  "is_text": false
}

### Fields

FieldTypeDescriptionpathstringInput path (or - for stdin)labelstringDetected file type label (e.g., pdf, png, python)mime_typestringMIME type (e.g., application/pdf)scorefloatConfidence score (0.0–1.0)groupstringCategory (e.g., document, image, code)descriptionstringHuman-readable descriptionis_textboolWhether the file is text-based

### Exit Codes

CodeMeaning0All files detected successfully1Fatal error (no results produced)2Partial failure (some files failed, some succeeded)

### Error Handling

Errors are printed to stderr. Common cases:

File not found: error: path/to/file: No such file or directory
Permission denied: error: path/to/file: Permission denied
Not a regular file: error: path/to/dir: Not a regular file

When processing multiple files, detection continues for remaining files even if some fail.

### Limitations

Default stdin mode (spool) writes stdin to a temporary file and uses Magika path detection.
--stdin-mode head is best effort and may miss trailing-byte signatures.
Very small files (< ~16 bytes) may produce low-confidence results
Empty files are detected as empty
Detection is content-based — file extensions are ignored

### Security Context

MITRE ATT&CK: Masquerading
Proofpoint: Call It What You Want, Threat Actor Delivers Highly Targeted Multistage Polyglot
## Trust
- Source: tencent
- Verification: Indexed source record
- Publisher: pgeraghty
- Version: 0.2.0
## Source health
- Status: healthy
- Item download looks usable.
- Yavira can redirect you to the upstream package for this item.
- Health scope: item
- Reason: direct_download_ok
- Checked at: 2026-05-02T12:06:01.680Z
- Expires at: 2026-05-09T12:06:01.680Z
- Recommended action: Download for OpenClaw
## Links
- [Detail page](https://openagent3.xyz/skills/detect-file-type-local)
- [Send to Agent page](https://openagent3.xyz/skills/detect-file-type-local/agent)
- [JSON manifest](https://openagent3.xyz/skills/detect-file-type-local/agent.json)
- [Markdown brief](https://openagent3.xyz/skills/detect-file-type-local/agent.md)
- [Download page](https://openagent3.xyz/downloads/detect-file-type-local)