google/magika — reverse-engineered prompt
Reverse engineered prompt
Build me an AI powered file type detector that can tell what a file really is from its contents, not just from the name or extension. I want it to work fast on a normal computer, handle both text and binary files, and recognize lots of common formats like source code, documents, archives, images, config files, emails, and unknown data.
Please make a clean command line tool where I can pass one file, many files, a whole folder recursively, or content from standard input. The normal output should be easy to read, and there should also be options for JSON, JSON lines, MIME type, simple labels, confidence score, and different confidence modes like cautious, normal, and best guess.
Also include a Python API and a JavaScript package so other apps can call it directly. Add clear install steps, examples, tests with sample files, and a simple demo page that runs locally in the browser if possible. Look up current docs online if you need to.
Want more depth? Deep Reverse