Simple command line tool written in Swift that takes a multi-page PDF file as its only argument then creates a PDF booklet, ready to print to a double-sided printer.
In the Release folder you can find Installer package with the Finder Quick Action (Automator workflow) and embedded binary as well as a sample multipage PDF document with the expected output of the tool.
In order to use the Swift command line utilities on older macOS operating systems you need to download from Apple and install the Swift 5 Runtime Support for Command Line Tools from Apple at https://support.apple.com/kb/DL1998