{"id":26455043,"url":"https://github.com/hamzabow/dialog","last_synced_at":"2025-03-18T20:29:46.815Z","repository":{"id":282128762,"uuid":"947575540","full_name":"hamzabow/dialog","owner":"hamzabow","description":"A command-line interface for displaying native system dialogs (file pickers, folder selection, message boxes) directly from terminal or scripts. Makes it easy to integrate GUI dialog elements into CLI workflows across Windows, macOS, and Linux.","archived":false,"fork":false,"pushed_at":"2025-03-12T23:46:04.000Z","size":9,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-03-13T00:25:42.346Z","etag":null,"topics":["cli","command-line-tool","cross-platform","dialog","go","golang","message-box","select-file","select-folder-path","shell-scripting","terminal-utilities"],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/hamzabow.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2025-03-12T22:59:25.000Z","updated_at":"2025-03-12T23:46:08.000Z","dependencies_parsed_at":"2025-03-13T00:35:59.522Z","dependency_job_id":null,"html_url":"https://github.com/hamzabow/dialog","commit_stats":null,"previous_names":["hamzabow/dialog"],"tags_count":3,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hamzabow%2Fdialog","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hamzabow%2Fdialog/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hamzabow%2Fdialog/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hamzabow%2Fdialog/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/hamzabow","download_url":"https://codeload.github.com/hamzabow/dialog/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":244300894,"owners_count":20430834,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["cli","command-line-tool","cross-platform","dialog","go","golang","message-box","select-file","select-folder-path","shell-scripting","terminal-utilities"],"created_at":"2025-03-18T20:29:46.226Z","updated_at":"2025-03-18T20:29:46.790Z","avatar_url":"https://github.com/hamzabow.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Dialog CLI\n\n[![Build Status](https://github.com/hamzabow/dialog/actions/workflows/build.yaml/badge.svg)](https://github.com/hamzabow/dialog/actions/workflows/build.yaml)\n[![Release](https://img.shields.io/github/v/release/hamzabow/dialog)](https://github.com/hamzabow/dialog/releases/latest)\n\nA command-line interface that allows users to interact with system dialogs like file pickers, folder pickers, and message boxes.\n\nThis CLI is a wrapper around the [sqweek/dialog](https://github.com/sqweek/dialog) library, providing a convenient way to show native GUI dialogs directly from command-line scripts or terminal commands.\n\n## Platform Support\n\n**Currently, only Windows 11 is supported** (this is the only platform where it has been tested).\n\nWhile the underlying library states that it supports Linux and macOS, this CLI tool hasn't been tested on those platforms yet.\n\n## Installation\n\n### Prerequisites\n- Go 1.21 or higher ([Installation Guide](https://go.dev/doc/install))\n\n### Install\n```powershell\ngo install github.com/hamzabow/dialog@latest\n```\n\n## Usage\n\n### File Selection Dialog\n\nOpen a file selection dialog and get the selected file path:\n\n```powershell\n# Open a file dialog\ndialog file\n\n# With a custom title\ndialog file --title \"Select a configuration file\"\n\n# Start in a specific directory\ndialog file --directory \"C:\\Users\\Public\\Documents\"\n\n# Show a save dialog instead of open dialog\ndialog file --save\n\n# Filter files by type\ndialog file --filter \"Images (*.jpg *.png)\" --filter \"Documents (*.pdf *.doc)\"\n```\n\n### Directory Selection Dialog\n\nOpen a directory selection dialog and get the selected directory path:\n\n```powershell\n# Open a directory dialog\ndialog directory\n\n# Shorthand aliases\ndialog dir\ndialog folder\n\n# With a custom title\ndialog directory --title \"Select output folder\"\n\n# Start in a specific directory\ndialog directory --directory \"C:\\Users\\Public\\Documents\"\n```\n\n### Message Box\n\nShow a message box dialog:\n\n```powershell\n# Show an info message\ndialog message \"Operation completed successfully\"\n\n# Show an error message\ndialog message \"Failed to connect to server\" --type error\n\n# With a custom title\ndialog message \"Hello World\" --title \"Greeting\"\n```\n\n### Confirmation Dialog\n\nShow a yes/no confirmation dialog:\n\n```powershell\n# Ask for confirmation\ndialog confirm \"Are you sure you want to proceed?\"\n\n# With a custom title\ndialog confirm \"Delete this file?\" --title \"Warning\"\n```\n\nThe confirm command returns exit code 0 if the user clicked \"Yes\" and exit code 1 if the user clicked \"No\" or cancelled the dialog.\n\n## Examples\n\n### Use in PowerShell scripts\n\n```powershell\n# Ask for confirmation\ndialog confirm \"Do you want to continue?\"\nif ($LASTEXITCODE -eq 0) {\n    Write-Host \"User chose YES\"\n\n    # Select a file\n    $CONFIG_FILE = dialog file --title \"Select configuration file\"\n    Write-Host \"Selected file: $CONFIG_FILE\"\n\n    # Select an output directory\n    $OUTPUT_DIR = dialog directory --title \"Select output directory\"\n    Write-Host \"Selected directory: $OUTPUT_DIR\"\n\n    # Show success message\n    dialog message \"Operation completed successfully\"\n} else {\n    Write-Host \"User chose NO\"\n    dialog message \"Operation cancelled\" --type error\n}\n```\n\n### Use in WSL (Windows Subsystem for Linux)\n\nSince WSL can access Windows executables that are in the PATH, you can use this tool in bash scripts when running under WSL. You'll need to call it with the `.exe` extension:\n\n```bash\n#!/bin/bash\n\n# Ask for confirmation\nif dialog.exe confirm \"Do you want to continue?\"; then\n    echo \"User chose YES\"\n\n    # Select a file\n    CONFIG_FILE=$(dialog.exe file --title \"Select configuration file\")\n    echo \"Selected file: $CONFIG_FILE\"\n\n    # Select an output directory\n    OUTPUT_DIR=$(dialog.exe directory --title \"Select output directory\")\n    echo \"Selected directory: $OUTPUT_DIR\"\n\n    # Show success message\n    dialog.exe message \"Operation completed successfully\"\nelse\n    echo \"User chose NO\"\n    dialog.exe message \"Operation cancelled\" --type error\nfi\n```\n\n## License\n\nThis project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhamzabow%2Fdialog","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fhamzabow%2Fdialog","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhamzabow%2Fdialog/lists"}