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 for a given file extension or URL scheme (Like when you double click a file in Finder)
- 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
-
macOS-First
-
Declarative Configuration
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
Please make sure just (Our command-runner) is installed before running. If you don't want to use just, the project is managed with SPM, and you can build with "Swift build -c release" and move the result in the .build folder to wherever.
git clone https://github.com/philocalyst/infat.git && cd infat just package && mv dist/infat* /usr/local/bin/infat # Wildcard because output name includes platform
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.