talira

A command-line tool to select default applications for document types and URL schemes on macOS

open sourcepublic domainself-hostablefree

duti is a command-line utility that sets the default applications for document types and URL schemes on macOS, using Apple's Uniform Type Identifiers. It reads settings from standard input, a settings file, a property list or command-line arguments, so the defaults for a Mac can be kept in a file and applied in one go, and it can print the default application for a file extension. It was released into the public domain by Andrew Mortensen, and the README says it is unsupported.

Ways to install

Package managers

Problems it solves

  • set which app opens PDF or Markdown files on my Mac from a script
  • make my preferred browser handle http links from the command line
  • apply the same default apps on every new Mac from a dotfiles settings file
  • find out which application opens .jpg files and its bundle ID
  • change the handler for a URL scheme like ftp:// without clicking through Finder

Features

  • set default handlers by bundle ID and UTI
  • set URL scheme handlers
  • settings from standard input, a settings file, a plist or arguments
  • apply every settings file in a directory
  • -x prints the default application for an extension

Capabilities

Has a command line toolplan not known