Sign inDemoInstall

Package Overview
File Explorer

Install Socket

Protect your apps from supply chain attacks


Package zenity provides cross-platform access to simple dialogs that interact graphically with the user. It is inspired by, and closely follows the API of, the zenity program, which it uses to provide the functionality on various Unixes. See: This package does not require cgo, and it does not impose any threading or initialization requirements.


Version published


# Zenity dialogs for Golang, Windows and macOS

[![Go Reference](](
[![Go Report](](
[![Go Coverage](](
[![Mentioned in Awesome Go](](

This repo includes:
- a cross-platform [Go]( package providing
[Zenity]( dialogs
(simple dialogs that interact graphically with the user)
- a *“port”* of the `zenity` command to both Windows and macOS based on that library.

Implemented dialogs:
* [message]( (error, info, question, warning)
* [text entry](
* [list]( (simple)
* [password](
* [file selection](
* [color selection](
* [calendar](
* [progress](
* [notification](

Behavior on Windows, macOS and other Unixes might differ slightly.
Some of that is intended (reflecting platform differences),
other bits are unfortunate limitations.

## Installing

The Go package:

    go get

The `zenity` command on macOS/WSL using [Homebrew]( 🍺:

    brew install ncruces/tap/zenity

The `zenity` command on Windows using [Scoop]( 🍨:

    scoop install

The `zenity` command on macOS/Windows, if you have [Go](

    go install

Or download the [latest release](

## Using

For the Go package, consult the [documentation](
and [examples](

The `zenity` command does its best to be compatible with the GNOME version.\
Consult the [documentation](
and [man page]( of that command.

## Why?

#### Benefits of the Go package:

* no `cgo` (see [benefits](, mostly cross-compilation)
* no main loop (or any other threading or initialization requirements)
* cancelation through [`context`](
* on Windows:
  * no additional dependencies
    * Explorer shell not required
    * works in Server Core
  * Unicode support
  * High DPI (no manifest required)
  * Visual Styles (no manifest required)
  * WSL/Cygwin/MSYS2 [support](,-Cygwin,-MSYS2)
* on macOS:
  * only dependency is `osascript`
* on other Unixes:
  * wraps either one of `zenity`, `matedialog`, [`qarma`](

## Credits

I'd like to thank all [contributors](,
but [@gen2brain]( in particular
for [`dlgs`](,
which was instrumental to the Windows port of `zenity`.


Last updated on 03 Aug 2023

Did you know?

Socket installs a GitHub app to automatically flag issues on every pull request and report the health of your dependencies. Find out what is inside your node modules and prevent malicious activity before you update the dependencies.


Related posts

SocketSocket SOC 2 Logo


  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.

  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc