Clone of duti (in swift)
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Type Name Latest commit message Commit time
Failed to load latest commit information.

cdef is a handy command-line tool to mess with your default applications.

I currently use it to:

  • Change default browser to Chrome
  • Change .xml handling from Xcode to TextMate

It uses:

  • URL
  • UTI

Download it from the Releases page

Note: Please fork and Pull Request, or create an issue

What are UTI? (Uniform Type Identifiers)

Uniform type identifiers (UTIs) provide a unified way to identify data handled within the system, such as documents, pasteboard data, and bundles. This chapter describes the concepts behind UTIs and shows how to specify them in your application bundles.

Have more information on Apple's website


###Get the default application to open PNG files:

$ cdef -readdefaultuti public.png
public.png ->

###Get all applications that can open PNG files:

$ cdef -readalluti public.png
public.png -> com.pixelmatorteam.pixelmator
public.png -> com.tapbots.TweetbotMac
public.png -> com.omnigroup.OmniGraffle6.MacAppStore
public.png ->
public.png ->

###Get which application will open http:// URLs:

$ cdef -readdefaulturl http
http ->

###Change your default browser to Chrome:

$ cdef -writedefaulturl http

###Get supported URL types for Apple Mail:

$ cdef -readURLTypes /Applications/

###Get supported Document types for Apple Mail:

√        -> Application is default for this type
x        -> Application supports but is not default for this type

(Viewer) -> Application can open these files in read-only
(Editor) -> Application can modify these files
(None)   -> Application does not support this files
$ cdef -readDocumentTypes /Applications/
√ (Viewer)
√ (Viewer)
x (None)
√ (Editor)
√ (Editor)
√ (Editor)
√ (Editor)

Note: This will prompt a dialog to ask the user to confirm the change to Chrome.

I use it in my deployments as a Casper policy that executes /usr/bin/sudo -u#501 /usr/local/bin/cdef -writedefaulturl http

See the list of UTIs here:


You're more than welcome to contribute to the code!

Everything needed to create a package is under cdef-Package/. Just run cdef-Package/ !

You will need to change the Team ID & Certificate.

But... please PR so we can keep only one repository.