Disk Maker X [1] is a GUI which has been around a long time and does this. That said, it's closed source which could make a person justifiably twitchy when manipulating the installer.
Open the .app in Script Editor. It's pure AppleScript, albeit with some do shell scripts.