{"id":24738626,"url":"https://github.com/zweifisch/cliui","last_synced_at":"2026-07-04T10:31:18.523Z","repository":{"id":8607601,"uuid":"10246905","full_name":"zweifisch/cliui","owner":"zweifisch","description":"utils for command line user iteraction","archived":false,"fork":false,"pushed_at":"2013-05-23T15:44:31.000Z","size":108,"stargazers_count":1,"open_issues_count":1,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2026-04-19T03:17:06.586Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/zweifisch.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2013-05-23T15:29:14.000Z","updated_at":"2014-03-16T17:52:27.000Z","dependencies_parsed_at":"2022-09-23T21:30:21.725Z","dependency_job_id":null,"html_url":"https://github.com/zweifisch/cliui","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/zweifisch/cliui","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zweifisch%2Fcliui","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zweifisch%2Fcliui/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zweifisch%2Fcliui/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zweifisch%2Fcliui/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/zweifisch","download_url":"https://codeload.github.com/zweifisch/cliui/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zweifisch%2Fcliui/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":35118970,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-07-04T02:00:05.987Z","response_time":113,"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":[],"created_at":"2025-01-27T22:55:04.993Z","updated_at":"2026-07-04T10:31:18.508Z","avatar_url":"https://github.com/zweifisch.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# cliui\n\nutils for command line user iteraction\n\n* prompt\n* confirm\n* safedit\n\ndecorators\n\n* sudo\n* sigint\n\nprompt\n\n```py\nfrom cliui import prompt\n\nprint(prompt('name? '))\nprint(prompt('age? ', 18))\n```\n\nconfirm\n\n```py\nfrom cliui import confirm\nimport sys\n\nconfirm('continue?')        #  continue? [y/n]\nconfirm('continue?', True)  #  continue? [Y/n]\nconfirm('continue?', False) #  continue? [y/N]\n\nif not confirm('continue?'):\n\tsys.exit(0)\n```\n\nsafedit\n\n```py\nfrom cliui import safedit\nimport json\n\ndef is_json(content):\n\ttry:\n\t\tjson.loads(content)\n\t\treturn True\n\texcept:\n\t\treturn False\n\nif safedit('test.json',is_json):\n\tprint('done')\nelse:\n\tprint('wrong format')\n```\n\nsudo\n\n```py\nfrom cliui import sudo\n\n@sudo\ndef main():\n\tprint('done')\n\nif not main():\n\tprint('pls run as root')\n```\n\nsigint\n\n```py\nfrom cliui import sigint\nimport sys\n\n@sigint\ndef onsigint(signal, frame):\n\tprint('caught user interupt')\n\n@sigint\ndef onsigint2(signal, frame):\n\tprint('quit')\n\tsys.exit(0)\n\nwhile True:\n\ttime.sleep(1)\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fzweifisch%2Fcliui","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fzweifisch%2Fcliui","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fzweifisch%2Fcliui/lists"}