{"id":15211183,"url":"https://github.com/contains-io/rcli","last_synced_at":"2025-10-03T03:30:29.918Z","repository":{"id":57460252,"uuid":"77511861","full_name":"contains-io/rcli","owner":"contains-io","description":"Rapidly create full-featured command line interfaces with help, subcommand dispatch, and validation.","archived":true,"fork":false,"pushed_at":"2020-05-25T02:40:29.000Z","size":189,"stargazers_count":12,"open_issues_count":6,"forks_count":5,"subscribers_count":4,"default_branch":"master","last_synced_at":"2024-04-26T00:25:46.973Z","etag":null,"topics":["autocomplete","bash","command-line","command-line-tool","docopt","pep484","python","python2","python3","type-hints","types","zsh"],"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/contains-io.png","metadata":{"files":{"readme":"README.rst","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}},"created_at":"2016-12-28T07:17:50.000Z","updated_at":"2023-12-01T07:27:53.000Z","dependencies_parsed_at":"2022-08-28T14:02:41.486Z","dependency_job_id":null,"html_url":"https://github.com/contains-io/rcli","commit_stats":null,"previous_names":[],"tags_count":15,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/contains-io%2Frcli","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/contains-io%2Frcli/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/contains-io%2Frcli/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/contains-io%2Frcli/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/contains-io","download_url":"https://codeload.github.com/contains-io/rcli/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":235069312,"owners_count":18930936,"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":["autocomplete","bash","command-line","command-line-tool","docopt","pep484","python","python2","python3","type-hints","types","zsh"],"created_at":"2024-09-28T08:20:41.040Z","updated_at":"2025-10-03T03:30:29.594Z","avatar_url":"https://github.com/contains-io.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"rcli\n====\n\n|PyPI| |Python Versions| |Build Status| |Coverage Status| |Code Quality|\n\n*Rapidly create full-featured command line interfaces with help, subcommand\ndispatch, and validation.*\n\n``rcli`` uses docopt_ to give you the control over your usage messages that you\nwant, but adds functionality such as automatic subcommand dispatching, usage\nstring wrapping, internationalization, and parameter validation.\n\n\nInstallation\n------------\n\nInstall it using pip:\n\n::\n\n    pip install rcli\n\n\nFeatures\n--------\n\n- Automatic creation of console scripts and entry points based on usage\n  strings.\n- Argument parsing based on usage string.\n- Usage string wrapping.\n- Command line arguments are normalized into python function parameters.\n- Validation of command line arguments using `PEP 484`_ type hints.\n- Logging with multiple levels and crash log generation.\n- Color coded logging based on log level.\n- Extensible subcommand generation based on entry point groups.\n\n\nUpcoming Features\n-----------------\n\n- Automatic generation of bash and zsh autocompletion scripts.\n- Internationalization of usage strings.\n\n\nBasic Usage\n-----------\n\nTo use ``rcli``, add ``rcli`` to your ``setup_requires`` argument in your\n*setup.py* and set the ``autodetect_commands`` parameter to ``True``.\n\n.. code-block:: python\n\n    from setuptools import setup\n    setup(\n        ...,\n        install_requires=['rcli'],\n        setup_requires=['rcli'],\n        autodetect_commands=True,\n        ...,\n    )\n\nIn your code, create a function with a usage string as its docstring and type\nhint annotations for validation.\n\n.. code-block:: python\n\n    def repeat(message: str, num_times: int):\n        \"\"\"Usage: repeat \u003cmessage\u003e [--num-times \u003cnum\u003e]\n\n        Arguments:\n            message  A message to print to the console.\n\n        Options:\n            -n, --num-times \u003cnum\u003e  The number of times to print the message [default: 1].\n        \"\"\"\n        for i in range(num_times):\n            print(message)\n\nOnce your package is installed, a new console script *repeat* will be\nautomatically generated that will validate and normalize your parameters and\ncall your function.\n\n\nSubcommand Dispatch\n-------------------\n\nTo generate a git-style command line interface with subcommand dispatching, you\nonly need to create your subcommand functions and your primary command will\nbe automatically generated for you.\n\n.. code-block:: python\n\n    def roar():\n        \"\"\"Usage: cat-sounds roar\"\"\"\n        print('ROAR!')\n\n    def meow():\n        \"\"\"Usage: cat-sounds meow\"\"\"\n        print('Meow!')\n\nThis automatically generates the command *cat-sounds* with the following help\nmessage::\n\n    Usage:\n      cat-sounds [--help] [--version] [--log-level \u003clevel\u003e | --debug | --verbose]\n                 \u003ccommand\u003e [\u003cargs\u003e...]\n\n    Options:\n      -h, --help           Display this help message and exit.\n      -V, --version        Display the version and exit.\n      -d, --debug          Set the log level to DEBUG.\n      -v, --verbose        Set the log level to INFO.\n      --log-level \u003clevel\u003e  Set the log level to one of DEBUG, INFO, WARN, or ERROR.\n\n    'cat-sounds help -a' lists all available subcommands.\n    See 'cat-sounds help \u003ccommand\u003e' for more information on a specific command.\n\n\n.. _PEP 484: https://www.python.org/dev/peps/pep-0484/\n.. _docopt: http://docopt.org/\n\n.. |Build Status| image:: https://travis-ci.org/contains-io/rcli.svg?branch=master\n   :target: https://travis-ci.org/contains-io/rcli\n.. |Coverage Status| image:: https://coveralls.io/repos/github/contains-io/rcli/badge.svg?branch=master\n   :target: https://coveralls.io/github/contains-io/rcli?branch=master\n.. |PyPI| image:: https://img.shields.io/pypi/v/rcli.svg\n   :target: https://pypi.python.org/pypi/rcli/\n.. |Python Versions| image:: https://img.shields.io/pypi/pyversions/rcli.svg\n   :target: https://pypi.python.org/pypi/rcli/\n.. |Code Quality| image:: https://api.codacy.com/project/badge/Grade/61ee45c79340430793ce074748f69686\n   :target: https://www.codacy.com/app/contains-io/rcli?utm_source=github.com\u0026amp;utm_medium=referral\u0026amp;utm_content=contains-io/rcli\u0026amp;utm_campaign=Badge_Grade\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcontains-io%2Frcli","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcontains-io%2Frcli","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcontains-io%2Frcli/lists"}