Installation
Batin can be installed through various package managers or built from source. Choose the method that works best for your platform.
Prerequisites
- Rust 1.75+ (if building from source)
- Node.js 18+ (if building documentation)
Package Managers
🍎 macOS (Homebrew)
brew tap ahmeddwalid/batin
brew install batin
🐧 Arch Linux (AUR)
Using yay:
yay -S batin
Using paru:
paru -S batin
🎩 Fedora / RHEL (COPR)
sudo dnf copr enable ahmeddwalid/batin
sudo dnf install batin
🍥 Debian / Ubuntu
sudo add-apt-repository ppa:ahmeddwalid/batin
sudo apt update
sudo apt install batin
🪟 Windows (Chocolatey)
choco install batin
😈 FreeBSD (Ports)
cd /usr/ports/security/batin
make install clean
# Or via pkg
pkg install batin
Using Cargo
If you have Rust installed, you can install Batin directly from crates.io:
cargo install batin
With Specific Features
# Full installation (all features)
cargo install batin --all-features
# Minimal installation (core detection only)
cargo install batin --no-default-features
# With specific features
cargo install batin --features "hashing,archive"
Building from Source
1. Clone the Repository
git clone https://github.com/ahmeddwalid/batin.git
cd batin
2. Build Release Binary
cargo build --release
The binary will be at target/release/batin.
3. Install Locally
# Copy to a directory in your PATH
sudo cp target/release/batin /usr/local/bin/
# Or install via cargo
cargo install --path .
4. Verify Installation
batin --version
Docker
Pull from Docker Hub
docker pull ahmeddwalid/batin:latest
Run Container
# Scan a single file
docker run --rm -v /path/to/files:/data ahmeddwalid/batin scan /data/file.pdf
# Scan a directory
docker run --rm -v /path/to/files:/data ahmeddwalid/batin scan /data --recursive
Build Docker Image Locally
docker build -t batin .
Verify Installation
After installation, verify Batin is working correctly:
# Check version
batin --version
# Run a test scan
echo "test" > /tmp/test.txt
batin scan /tmp/test.txt
# Expected output shows the file type detection result
Platform Support
| Platform | x86_64 | x86_32 | ARM64 | ARMv7 | RISC-V |
|---|---|---|---|---|---|
| Linux | ✅ | ✅ | ✅ | ✅ | ✅ |
| Windows | ✅ | ✅ | ✅ | ❌ | ❌ |
| macOS | ✅ | ❌ | ✅ | ❌ | ❌ |
| FreeBSD | ✅ | ❓ | ❓ | ❌ | ❌ |
Feature Flags
Batin supports optional features that can be enabled at compile time:
| Feature | Description | Default |
|---|---|---|
cli | Command-line interface | ✅ |
hashing | MD5/SHA-256 file hashing | ✅ |
binary-parsing | PE/ELF metadata extraction | ✅ |
archive | ZIP/TAR archive scanning | ✅ |
Example: Minimal Build
cargo build --release --no-default-features
This builds only the core detection library without CLI or optional features.
Next Steps
Now that Batin is installed, head to the Quick Start guide to perform your first scan!