2025-04-24 13:37:00
github.com
Infat is an ultra-powerful, macOS-native CLI tool for declaritively managing both file-type and URL-scheme associations. Avoid the hassle of navigating sub-menus to setup your default browser or image viewer, and the pain of doing that every time you get a new machine. Setup the rules once, and bask in your own ingenuity forevermore. Take back control, and bind your openers to whatever. You. Want. Override everything! Who’s going to stop you?
- List which apps open a given file extension or URL scheme
- Set a default application for a file extension or URL scheme
- Load associations from a TOML config (
[files]
and[schemes]
tables) - Verbose, scriptable, and ideal for power users and admins
Get started by installing Infat — jump to the Install section below.
# Show the default app for .txt files
infat list txt
# Show all registered apps for .txt files
infat list --assigned txt
# Use TextEdit for .md files
infat set TextEdit --file-type md
# Use VSCode for .json files
infat set VSCode --file-type json
# Use Mail.app for mailto: links
infat set Mail --scheme mailto
Place a TOML file at $XDG_CONFIG_HOME/infat/config.toml
(or pass --config path/to/config.toml
) with two tables:
[files]
md = "TextEdit"
html = "Safari"
pdf = "Preview"
[schemes]
mailto = "Mail"
web = "Safari"
Run without arguments to apply all entries.
infat --config ~/.config/infat/config.toml
-
Minimal & Scriptable
Infat is a single-binary tool that plays well in shells and automation pipelines. -
macOS-First
Leverages nativeNSWorkspace
, Launch Services, and UTType for robust integration. -
Declarative Configuration
TOML support allows you to version-control your associations alongside other dotfiles.
You’ll need just and Swift 5.9+:
# Debug build
just build
# Release build
just build-release
# Run in debug mode
just run "list txt"
# Enable verbose logging for troubleshooting
infat --verbose list pdf
brew install philocalyst/tap/infat
git clone https://github.com/philocalyst/infat.git
cd infat
just build-release
cp .build/release/infat /usr/local/bin/infat
For the full history of changes, see CHANGELOG.md.
- Inspired by duti
- Built with Swift, thanks to corporate overlord Apple’s frameworks
- Thanks to all contributors and issue submitters (One day!!)
Infat is licensed under the MIT License.
Feel free to use, modify, and distribute!
Keep your files stored safely and securely with the SanDisk 2TB Extreme Portable SSD. With over 69,505 ratings and an impressive 4.6 out of 5 stars, this product has been purchased over 8K+ times in the past month. At only $129.99, this Amazon’s Choice product is a must-have for secure file storage.
Help keep private content private with the included password protection featuring 256-bit AES hardware encryption. Order now for just $129.99 on Amazon!
Help Power Techcratic’s Future – Scan To Support
If Techcratic’s content and insights have helped you, consider giving back by supporting the platform with crypto. Every contribution makes a difference, whether it’s for high-quality content, server maintenance, or future updates. Techcratic is constantly evolving, and your support helps drive that progress.
As a solo operator who wears all the hats, creating content, managing the tech, and running the site, your support allows me to stay focused on delivering valuable resources. Your support keeps everything running smoothly and enables me to continue creating the content you love. I’m deeply grateful for your support, it truly means the world to me! Thank you!
BITCOIN bc1qlszw7elx2qahjwvaryh0tkgg8y68enw30gpvge Scan the QR code with your crypto wallet app |
DOGECOIN D64GwvvYQxFXYyan3oQCrmWfidf6T3JpBA Scan the QR code with your crypto wallet app |
ETHEREUM 0xe9BC980DF3d985730dA827996B43E4A62CCBAA7a Scan the QR code with your crypto wallet app |
Please read the Privacy and Security Disclaimer on how Techcratic handles your support.
Disclaimer: As an Amazon Associate, Techcratic may earn from qualifying purchases.