I'm working on an Electron based application to write OS images to removable drives, which is being packaged as an *.app for OS X.

Along with the GUI application, I'd like to ship a CLI version bundled with the app, that does the same thing, however I'm not sure how to make it accessible to the users.

I guess I could put the binary in Contents/MacOS and ask the users to add this to the PATH, however this would be a very bad experience for the users.

What is the recommended way to ship an command-line tool along with your *.app?

Alternatively, I could add another *.app for the CLI tool inside the DMG I distribute to users so they optionally install as well, but having two separate *.app would be a bit confusing, and in any case, there doesn't seem to be a way to instruct an *.app to make its binary accessible to the PATH.

  • 1
    Can You make it as an pkg installer? – Mateusz Szlosek Apr 20 '16 at 14:21
  • 1
    @MateuszSzlosek That's a good alternative, although having them all together would even nicer. – jviotti Apr 20 '16 at 14:26
  • Just a thought but BBEdit has command line tools. You can install them from within the program from the BBEdit menu. Perhaps someone is more familiar with this method? – Steve Chambers Apr 20 '16 at 16:01

You can place a link to the contents/macos/app in a location that is in the users path. You don't need to have a separate binary with this approach but your app does need to handle command line arguments. That is not hard to do, but the details of that are beyond the scope of this site.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .