llmfile
v1.0.0
Published
A file type classifier using LLM analysis of file headers and footers
Maintainers
Readme
llmfile
A file type classifier that mimics the Linux file utility by using LLM analysis of file headers and footers.
Installation
Install globally:
npm install -g .Or use with npx (no installation required):
npx llmfile <file1> [file2] ...Usage
export BEDROCK_API_KEY="your-bedrock-api-key"
llmfile <file1> [file2] ...Or with npx:
export BEDROCK_API_KEY="your-bedrock-api-key"
npx llmfile <file1> [file2] ...Examples
% llmfile index.js
index.js: JavaScript text, UTF-8 Unicode (node.js) text
% file index.js
index.js: a /usr/bin/env node script text executable, ASCII textHow it works
- Reads the first 512 bytes (header) and last 512 bytes (footer) of each file
- Converts the binary data to hexadecimal format
- Sends the hex data to AWS Bedrock
- Returns file type classification similar to the Linux
filecommand
