Fixing the `opendiff` command line tool

On my Mac, you can use this command like…

opendiff index.html index-2.htmlCode language: CSS (css)

And it’ll open some built-in GUI app called FileMerge to show you the diff.

Screenshot of FileMerge comparing two HTML files, showing a difference in <h1> tags with 'Not Cool' on the left and 'Cool' on the right, and indicating 1 difference.

It wasn’t working for me. I wish I copied the exact error but it was something about the path being wrong or the executable not being available or something.

The solution that worked for me was to open XCode and go to Settings > Location. The Command Line Tools section didn’t have anything selected, and I had to select XCode from the list.

Xcode locations settings panel showing Derived Data, Archives, Compilation Cache, and Command Line Tools paths.

Then opendiff started working again. 🤷‍♀️

Thoughts? Email me or comment below. Also CodePen PRO is quite a deal. 🙏

Leave a Reply

Your email address will not be published. Required fields are marked *