{"id":23575806,"url":"https://github.com/GabrieleInvernizzi/zig-prompter","last_synced_at":"2025-08-29T19:31:23.923Z","repository":{"id":267688933,"uuid":"902052011","full_name":"GabrieleInvernizzi/zig-prompter","owner":"GabrieleInvernizzi","description":"zig-prompter is a lightweight and flexible library for building and managing interactive text-based prompts.","archived":false,"fork":false,"pushed_at":"2025-07-11T14:06:43.000Z","size":66,"stargazers_count":19,"open_issues_count":0,"forks_count":1,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-07-11T16:36:04.639Z","etag":null,"topics":["cli","prompt","terminal","zig","zig-package"],"latest_commit_sha":null,"homepage":"https://gabrieleinvernizzi.github.io/zig-prompter/","language":"Zig","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/GabrieleInvernizzi.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,"zenodo":null}},"created_at":"2024-12-11T20:13:44.000Z","updated_at":"2025-07-11T14:07:00.000Z","dependencies_parsed_at":"2024-12-26T21:03:51.073Z","dependency_job_id":"bca097c0-423a-4618-a6d3-f23b61dabd10","html_url":"https://github.com/GabrieleInvernizzi/zig-prompter","commit_stats":null,"previous_names":["gabrieleinvernizzi/zig-prompter"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/GabrieleInvernizzi/zig-prompter","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/GabrieleInvernizzi%2Fzig-prompter","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/GabrieleInvernizzi%2Fzig-prompter/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/GabrieleInvernizzi%2Fzig-prompter/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/GabrieleInvernizzi%2Fzig-prompter/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/GabrieleInvernizzi","download_url":"https://codeload.github.com/GabrieleInvernizzi/zig-prompter/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/GabrieleInvernizzi%2Fzig-prompter/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":272749299,"owners_count":24986867,"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","status":"online","status_checked_at":"2025-08-29T02:00:10.610Z","response_time":87,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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","prompt","terminal","zig","zig-package"],"created_at":"2024-12-26T21:02:14.234Z","updated_at":"2025-08-29T19:31:23.909Z","avatar_url":"https://github.com/GabrieleInvernizzi.png","language":"Zig","funding_links":[],"categories":["Libraries","Language Essentials","\u003ca name=\"Zig\"\u003e\u003c/a\u003eZig"],"sub_categories":["Command Line and Argument Parser"],"readme":"# zig-prompter\n\n**zig-prompter** is a lightweight and flexible library for building and managing interactive text-based prompts in the [Zig programming language](https://ziglang.org/). Whether you're creating command-line tools, text-based games, or utilities requiring user input, **zig-prompter** simplifies the process with intuitive APIs and a robust feature set.\n\n## Installation\n\nFirst, add zig-prompter to your `build.zig.zon` file:\n```bash\nzig fetch --save git+https://github.com/GabrieleInvernizzi/zig-prompter/\n```\n\nUpdate your `build.zig` file to include the dependency:\n```zig\nconst prompter_dep = b.dependency(\"prompter\", .{\n        .target = target,\n        .optimize = optimize,\n    });\n\nexe.root_module.addImport(\"prompter\", prompter_dep.module(\"prompter\"));\n```\n\nHere’s an example of using **zig-prompter** to create a simple selection prompt:\n```zig\nconst std = @import(\"std\");\nconst Prompter = @import(\"prompter\");\n\npub fn main() !void {\n    var gpa = std.heap.GeneralPurposeAllocator(.{}){};\n    defer _ = gpa.deinit();\n    const allocator = gpa.allocator();\n    const stdout = std.io.getStdOut();\n\n    const theme = Prompter.Themes.SimpleTheme{};\n    var p = Prompter.Prompt.init(allocator, theme.theme());\n\n    const opts = [_][]const u8{ \"Option 1\", \"Option 2\", \"Option 3\" };\n    const sel_opt = try p.option(\"Select an option\", \u0026opts, 1);\n    if (sel_opt) |o| {\n        try stdout.writer().print(\"The selected option was: {s} (idx: {d})\\n\", .{ opts[o], o });\n    } else {\n        try stdout.writer().writeAll(\"The selection was aborted.\\n\");\n    }\n}\n```\n\nFor a more exhaustive example, take a look at the [example](https://github.com/GabrieleInvernizzi/zig-prompter/tree/main/example) directory.\n\n## Features\n- [x] String prompt\n- [x] Interactive option selection prompt\n- [x] Confirmation prompt\n- [x] Password prompt\n- [x] Input validation\n- [x] Advanced support for themes and personalization\n- [ ] Include more themes\n- [ ] Windows support\n\n## Contributions\nContributions are always welcome and greatly appreciated! Whether it's fixing bugs, adding features, improving documentation, or enhancing examples, your input helps make **zig-prompter** even better. Feel free to open issues to discuss potential improvements or submit pull requests directly.\n\nThank you for your support!\n\n## Acknowledgments  \nThis library was inspired by the fantastic **Rust** library [Dialoguer](https://github.com/mitsuhiko/dialoguer).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FGabrieleInvernizzi%2Fzig-prompter","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FGabrieleInvernizzi%2Fzig-prompter","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FGabrieleInvernizzi%2Fzig-prompter/lists"}