AI-powered file content type detection using Google Magika.
bash
# Single file — label output
magika -l /path/to/file
# MIME type output
magika -i /path/to/file
# Recursive directory scan
magika -r ./workspace/
# JSON output (for programmatic use)
magika --json /path/to/file
# Batch multiple files
magika -r --json ./uploads/
TaskCommandIdentify single filemagika -l <file>Get MIME typemagika -i <file>Recursive scanmagika -r <dir>Batch JSONmagika --jsonl <files...>With confidence scoremagika -s -l <file>
Magika identifies 200+ content types including: markdown, json, python, javascript, pdf, zip, png, jpeg, html, xml, sql, csv, png, gif, mp3, mp4, exe, elf, wasm, and many more.
High-confidence predictions are marked with [HIGH]. Low-confidence returns generic labels like text or unknown binary data.
bash
# pipx (recommended)
pipx install magika
# pip
pip install magika
# brew
brew install magika
# curl script
curl -LsSf https://securityresearch.google/magika/install.sh | sh