{"id":42325889,"url":"https://github.com/jpsca/proper-cli","last_synced_at":"2026-01-27T13:09:49.594Z","repository":{"id":62578148,"uuid":"443130686","full_name":"jpsca/proper-cli","owner":"jpsca","description":"A minimal and ridiculously good looking command-line-interface toolkit","archived":false,"fork":false,"pushed_at":"2024-04-01T14:47:35.000Z","size":326,"stargazers_count":5,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-11-21T21:06:17.619Z","etag":null,"topics":["cli","command-line","python","text-interface"],"latest_commit_sha":null,"homepage":"","language":"Python","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/jpsca.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"MIT-LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2021-12-30T16:40:13.000Z","updated_at":"2024-10-15T02:14:39.000Z","dependencies_parsed_at":"2023-02-12T03:31:17.972Z","dependency_job_id":null,"html_url":"https://github.com/jpsca/proper-cli","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"purl":"pkg:github/jpsca/proper-cli","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jpsca%2Fproper-cli","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jpsca%2Fproper-cli/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jpsca%2Fproper-cli/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jpsca%2Fproper-cli/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/jpsca","download_url":"https://codeload.github.com/jpsca/proper-cli/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jpsca%2Fproper-cli/sbom","scorecard":{"id":536152,"data":{"date":"2025-08-11","repo":{"name":"github.com/jpsca/proper-cli","commit":"8446894e45c3a2474ef534bca43f5fcfd3b1b7d0"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":3.1,"checks":[{"name":"Code-Review","score":0,"reason":"Found 0/19 approved changesets -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project requires human code review before pull requests (aka merge requests) are merged.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#code-review"}},{"name":"Binary-Artifacts","score":10,"reason":"no binaries found in the repo","details":null,"documentation":{"short":"Determines if the project has generated executable (binary) artifacts in the source repository.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#binary-artifacts"}},{"name":"Maintained","score":0,"reason":"0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project is \"actively maintained\".","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#maintained"}},{"name":"Token-Permissions","score":0,"reason":"detected GitHub workflow tokens with excessive permissions","details":["Warn: no topLevel permission defined: .github/workflows/run_tests.yml:1","Warn: no topLevel permission defined: .github/workflows/upload-to-pypi.yml:1","Info: no jobLevel write permissions found"],"documentation":{"short":"Determines if the project's workflows follow the principle of least privilege.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#token-permissions"}},{"name":"Packaging","score":-1,"reason":"packaging workflow not detected","details":["Warn: no GitHub/GitLab publishing workflow detected."],"documentation":{"short":"Determines if the project is published as a package that others can easily download, install, easily update, and uninstall.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#packaging"}},{"name":"Dangerous-Workflow","score":10,"reason":"no dangerous workflow patterns detected","details":null,"documentation":{"short":"Determines if the project's GitHub Action workflows avoid dangerous patterns.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#dangerous-workflow"}},{"name":"SAST","score":0,"reason":"no SAST tool detected","details":["Warn: no pull requests merged into dev branch"],"documentation":{"short":"Determines if the project uses static code analysis.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#sast"}},{"name":"Pinned-Dependencies","score":0,"reason":"dependency not pinned by hash detected -- score normalized to 0","details":["Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/run_tests.yml:14: update your workflow using https://app.stepsecurity.io/secureworkflow/jpsca/proper-cli/run_tests.yml/main?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/run_tests.yml:15: update your workflow using https://app.stepsecurity.io/secureworkflow/jpsca/proper-cli/run_tests.yml/main?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/run_tests.yml:29: update your workflow using https://app.stepsecurity.io/secureworkflow/jpsca/proper-cli/run_tests.yml/main?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/run_tests.yml:30: update your workflow using https://app.stepsecurity.io/secureworkflow/jpsca/proper-cli/run_tests.yml/main?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/upload-to-pypi.yml:14: update your workflow using https://app.stepsecurity.io/secureworkflow/jpsca/proper-cli/upload-to-pypi.yml/main?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/upload-to-pypi.yml:15: update your workflow using https://app.stepsecurity.io/secureworkflow/jpsca/proper-cli/upload-to-pypi.yml/main?enable=pin","Warn: downloadThenRun not pinned by hash: .github/workflows/run_tests.yml:18","Warn: downloadThenRun not pinned by hash: .github/workflows/run_tests.yml:35","Warn: downloadThenRun not pinned by hash: .github/workflows/upload-to-pypi.yml:21","Info:   0 out of   6 GitHub-owned GitHubAction dependencies pinned","Info:   0 out of   3 downloadThenRun dependencies pinned"],"documentation":{"short":"Determines if the project has declared and pinned the dependencies of its build process.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#pinned-dependencies"}},{"name":"CII-Best-Practices","score":0,"reason":"no effort to earn an OpenSSF best practices badge detected","details":null,"documentation":{"short":"Determines if the project has an OpenSSF (formerly CII) Best Practices Badge.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#cii-best-practices"}},{"name":"Security-Policy","score":0,"reason":"security policy file not detected","details":["Warn: no security policy file detected","Warn: no security file to analyze","Warn: no security file to analyze","Warn: no security file to analyze"],"documentation":{"short":"Determines if the project has published a security policy.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#security-policy"}},{"name":"Fuzzing","score":0,"reason":"project is not fuzzed","details":["Warn: no fuzzer integrations found"],"documentation":{"short":"Determines if the project uses fuzzing.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#fuzzing"}},{"name":"License","score":10,"reason":"license file detected","details":["Info: project has a license file: MIT-LICENSE:0","Info: FSF or OSI recognized license: MIT License: MIT-LICENSE:0"],"documentation":{"short":"Determines if the project has defined a license.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#license"}},{"name":"Signed-Releases","score":-1,"reason":"no releases found","details":null,"documentation":{"short":"Determines if the project cryptographically signs release artifacts.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#signed-releases"}},{"name":"Branch-Protection","score":0,"reason":"branch protection not enabled on development/release branches","details":["Warn: branch protection not enabled for branch 'main'"],"documentation":{"short":"Determines if the default and release branches are protected with GitHub's branch protection settings.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#branch-protection"}},{"name":"Vulnerabilities","score":6,"reason":"4 existing vulnerabilities detected","details":["Warn: Project is vulnerable to: PYSEC-2023-117 / GHSA-mrwq-x4v8-fh7p","Warn: Project is vulnerable to: PYSEC-2025-49 / GHSA-5rjg-fvgr-3xxf","Warn: Project is vulnerable to: GHSA-cx63-2mw6-8hw5","Warn: Project is vulnerable to: PYSEC-2024-187 / GHSA-rqc4-2hc7-8c8v"],"documentation":{"short":"Determines if the project has open, known unfixed vulnerabilities.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#vulnerabilities"}}]},"last_synced_at":"2025-08-20T07:00:37.651Z","repository_id":62578148,"created_at":"2025-08-20T07:00:37.651Z","updated_at":"2025-08-20T07:00:37.651Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28813276,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-27T12:25:15.069Z","status":"ssl_error","status_checked_at":"2026-01-27T12:25:05.297Z","response_time":168,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"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","command-line","python","text-interface"],"created_at":"2026-01-27T13:09:48.942Z","updated_at":"2026-01-27T13:09:49.584Z","avatar_url":"https://github.com/jpsca.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Proper CLI\n\nProper CLI is a Python library for creating composable, nestable, and ridiculously good looking command-line-**user**-interfaces from simple classes.\n\n![proper_cli output](https://raw.githubusercontent.com/jpsca/proper-cli/main/output.png)\n\n## Features\n\n- Made for interfacing **with humans**.\n- Arbitrary nesting and composition of commands.\n- Automatic help page generation\n- No need to redeclare paramaters and options with decorators, just write Python methods\n- The help of a command is its docstring, why make it more complex?\n\n\n## Usage\n\nDeclare a class that inherits from `proper_cli.Cli`. Every method/attribute that does not starts with an underscore will be a command.\n\n```python\nfrom proper_cli import Cli\n\nclass Manage(Cli):\n    def first(self, arg1, arg2=3):\n        pass\n\n    def second(self):\n        pass\n\n    def _not_a_command(self):\n        pass\n```\n\nThen, instance that class and call it.\n\n```python\n# run.py\ncli = Manage()\n\nif __name__ == \"__main__\":\n    cli()\n```\n\nThe class dosctring will be printed at the beginning of the help page.\n\nThe arguments can be then passed by position:\n\n```bash\npython run.py first foo bar\n```\n\nor by name:\n\n```bash\npython run.py first -arg1 foo -arg2 bar\n```\n\nTo pass a `True` use the name without a value, for a `False`, prepend the name of the argument with `no-`:\n\n```bash\npython run.py first -arg1 -no-arg2\n```\n\n\n### Subgroups\n\nIf an attribute is a subclass of `proper_cli.Cli`, it will be a subgroup:\n\n```python\nfrom proper_cli import Cli\n\nclass DBSub(Cli):\n    def migrate(self):\n        pass\n\nclass Manage(Cli):\n    # A subgroup\n    db = DBSub  # NOT `DBSub()`\n```\n\n### Context\n\nYou can pass any named argument as context to be used by your commands. This will be stored at the `_env` attribute.\n\nExample:\n\n```python\n\u003e\u003e\u003e cli = Manage(lorem=\"ipsum\")\n\u003e\u003e\u003e print(cli._env)\n{\"lorem\": \"ipsum\"}\n```\n\n\n## An example\n\nThe image at the top was autogenerated by running this example:\n\n```python\n# example.py\nfrom proper_cli import Cli\n\n\nclass DBCli(Cli):\n    \"\"\"Database-related commands\n    \"\"\"\n\n    def migrate(self, message):\n        \"\"\"Autogenerate a new revision file.\n\n        This is an alias for \"revision --autogenerate\".\n\n        Arguments:\n\n        - message: Revision message\n\n        \"\"\"\n        pass\n\n    def branches(self):\n        \"\"\"Show all branches.\"\"\"\n        pass\n\n\nclass MyCli(Cli):\n    \"\"\"Welcome to Proper CLI 3\n    \"\"\"\n\n    def new(self, path, quiet=False):\n        \"\"\"Creates a new Proper application at `path`.\n\n        Arguments:\n\n        - path: Where to create the new application.\n        - quiet [False]: Supress all output.\n        \"\"\"\n        pass\n\n    def hello(count, name):\n        \"\"\"Simple program that greets NAME for a total of COUNT times.\"\"\"\n        pass\n\n    # A subgroup!\n    db = DBCli\n\n\ncli = MyCli()\n\nif __name__ == \"__main__\":\n    cli()\n\n```\n\n\n## Coloring the Output\n\nWhenever you output text, you can surround the text with tags to color its output (thanks to https://github.com/sdispater/pastel).\nThis is automatically enabled for the docstrings, but you can also have it by using `proper_cli.echo()`\nas a drop-in replacement of `print()`.\n\n```python\n# green text\necho(\"\u003cfg=green\u003efoo\u003c/fg=green\u003e\")\n\n# black text on a cyan background\necho(\"\u003cfg=black;bg=cyan\u003efoo\u003c/\u003e\")\n\n# bold text on a yellow background\necho(\"\u003cbg=yellow;options=bold\u003efoo\u003c/\u003e\")\n```\n\nAvailable foreground and background colors are: black, red, green, yellow, blue, magenta, cyan and white.\n\nThe available options are: bold, underscore, blink, reverse and conceal.\n\nThe closing tag can be replaced by `\u003c/\u003e`, which revokes all formatting options established by the last opened tag.\n\n\n## Custom styles\n\nThese four styles are available by default:\n\n```python\n# green text\necho(\"\u003cinfo\u003efoo\u003c/info\u003e\")\n\n# yellow text\necho(\"\u003ccomment\u003efoo\u003c/comment\u003e\")\n\n# black text on a cyan background\necho(\"\u003cquestion\u003efoo\u003c/question\u003e\")\n\n# white text on a red background\necho(\"\u003cerror\u003efoo\u003c/error\u003e\")\n```\n\nIt is possible to define your own styles using the `proper_cli.add_style()` method:\n\n```python\nadd_style(\"fire\", fg=\"red\", bg=\"yellow\", options=[\"bold\", \"blink\"])\necho(\"\u003cfire\u003efoo\u003c/fire\u003e\")\n```\n\n\n## Helpers\n\nBeyond the CLI builder, proper_cli also includes some commonly-used helper functions\n\n### `confirm(question, default=False, yes_choices=YES_CHOICES, no_choices=NO_CHOICES)`\n\nAsk a yes/no question via and return their answer.\n\n### `ask(question, default=None, alternatives=None)`\n\nAsk a question via input() and return their answer.\n\n\n## FAQ\n\n### Why don't just use optparse or argparse?\n\nI find it too verbose.\n\n### Why don't just use click?\n\nAre you kidding? Because this looks better and is easier to use and understand.\n\n### Why don't just use...?\n\nBecause this library fits better my mental model. I hope it matches yours as well.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjpsca%2Fproper-cli","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjpsca%2Fproper-cli","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjpsca%2Fproper-cli/lists"}