gDialog - macOS Dialogs and Prompts

New Contributor

Hello Jamf Nation!


I'm happy to announce the release of gDialog, a new utility for macOS dialogs and prompts from terminal and scripts. 

gDialog is available for macOS Big Sur and Catalina and currently only as an Intel package, M1 Macs will require Rosetta in order to use gDialog.

The CLI was designed to be as close as possible to CocoaDialog where it made sense for an easy transition in the different workflows.


Full documentation, examples and download link can be found at


Available dialogs:

  • Message Box


  • Input Box


  • Secure Input Box


  • Text Box - macOS Big Sur+


  • Credentials Box


  • HTML Box - Capable of displaying simple HTML forms and advanced pages or websites and also a "kiosk" mode for a locked down full screen dialogs

          gdialog-htmlbox.png   gdialog-htmlbox-jamfnation.png

  • Progress Bar

          gdialog-progressbar.gif   gdialog-progressbar-indeterminate.gif

  • Picker Box




  • File Select



  • File Save



  • Banner Box




  • Notification (via Notification Center)



Looking forward to hear your comments and suggestions.



Gilad Darshan


Contributor III

@gdarshan hey gdialog and am attempting to use it in a rollout I'm working on.  I need to ask a question regarding the Credentials Box.  I've been reviewing the documentation and am unable to discern how the username and password are saved via the dialog box.  Would you be able to let me know how I can save these values so I can call them later?  I appreciate what you've created here.  Thanks. 

Hey @steve_summers,

Very sorry for the delay, Jamf didn't send me a notification on the comment so I recommend next time to open an issue in GitHub.


For the Credentials Box, you get back the values in separate lines:

  • Number of button clicked
  • Value of first field
  • Value of second field


For example, when entering "aloha" in the first field and "fluffy" in the second field:


Mac:~ root# /usr/local/gDialog/ credentialsbox --title "Title" --header "Header" --text "Enter your corporate credentials:" --focus



To save the values, you need to convert the result multi-line string to an array and save it in a variable.

I would also recommend to use the "--encode_text" option which will encode the values in base64 to ensure special characters are not being interpreted and you get exactly the values that were entered in the dialog (for example "\n" in the value will be interpreted as a new line).


First we run the command, convert it to array and store it in a variable called "CREDENTIALS":


Mac:~ root# CREDENTIALS=($(/usr/local/gDialog/ credentialsbox --title "Title" --header "Header" --text "Enter your corporate credentials:" --focus --encode_text))



Now we can get the stored values, since we used "--encode_text", the second and third array items will require decoding the base64:


Mac:~ root# echo -n "${CREDENTIALS[1]}"
Mac:~ root# echo -n "${CREDENTIALS[2]}" | base64 -D
Mac:~ root# echo -n "${CREDENTIALS[3]}" | base64 -D


As you can see above, array item 1 is the number of the button that was pressed and does not require decoding, item 2 is the encoded value of the first field and requires decoding the base64, item 3 is the encoded value of the second field and also requires decoding.


Please let me know if it answered your question or not.