One can wrap each shell command in an AppleScript command such as:
However, if the shell script contains sudo commands, it will fail to run. I am not yet familiar with Swift or making Cocoa applications, but for something as simple as running a few shell commands, AppleScript dialog boxes are sufficient. If an input is required, then a GUI is required. The user can just double-click on the application and the commands are run silently. The obvious answer is to wrap the script in an application, which is pushed to their Mac. But it is a little abstract for users to “install” something when they just want to run a tool. If you aren’t able to or do not wish to use Self Service, another method is to package up a shell script in a payload-free package, which will prompt the user for admin rights when they “install” it.
If you are using Jamf Pro and your users are familiar with using the Self Service app, you can create self-service policies which run scripts with admin rights. My aim was not to have to repeatedly send support emails or provide articles which require users to open Terminal and type in one or a more commands. The Mac users I support have admin rights, and I have recently had cause to provide end users with an easy way to run various shell commands which require admin rights (via sudo).