| Crates.io | wiza |
| lib.rs | wiza |
| version | 0.2.1 |
| created_at | 2025-11-14 15:38:24.505593+00 |
| updated_at | 2026-01-19 16:56:59.431463+00 |
| description | Command line tool for file identification |
| homepage | |
| repository | https://github.com/qjerome/magic-rs/ |
| max_upload_size | |
| id | 1933069 |
| size | 52,343 |
What is zat? Now you know.
A Rust-powered alternative to the file command, with JSON support, custom rules, and a sprinkle of magic.
-R flagcompile subcommandcargo install wiza
$ wiza /bin/file
/bin/file source:elf strength:431 mime:application/x-pie-executable magic:ELF 64-bit LSB pie executable, x86-64, version 1 (SYSV)
wiza can detect polyglot files - files that are valid in multiple formats.
To detect polyglot files, use the --all flag to show all matching rules:
$ wiza --all private/polyglot-database/files/resume_iso.pdf
resume_iso.pdf source:filesystems strength:495 mime:application/x-iso9660-image magic:ISO 9660 CD-ROM filesystem data (DOS/MBR boot sector) 'ISOIMAGE' (bootable)
resume_iso.pdf source:filesystems strength:155 mime:application/octet-stream magic:DOS/MBR boot sector
resume_iso.pdf source:pdf strength:141 mime:application/pdf magic:PDF document, version ë.ë
resume_iso.pdf source:filesystems strength:137 mime:application/octet-stream magic:DOS/MBR boot sector
resume_iso.pdf source:hardcoded strength:0 mime:application/octet-stream magic:data
$ wiza -j /bin/file | jq '.'
{
"path": "/bin/file",
"source": "elf",
"magic": "ELF 64-bit LSB pie executable, x86-64, version 1 (SYSV)",
"mime-type": "application/x-pie-executable",
"creator-code": null,
"strength": 431,
"extensions": [
"so"
]
}
$ wiza compile --rules custom_rules/ --output my_rules.db
$ wiza --db my_rules.db custom_file
file / libmagic rule formatCreate magic rule files following the standard magic format. Example:
# my_rules/xyz
0 string MYTYPE My custom file type
>4 byte 1 version 1
>4 byte 2 version 2
Then compile with:
wiza compile --rules my_rules/ --output my_rules.db
wiza is a playful combination of:
This project is licensed under the GPL-3.0 License.
Contributions are welcome! Please open an issue or submit a pull request.
file command but with modern improvements