{"id":16411416,"url":"https://github.com/yetone/script-manager","last_synced_at":"2025-10-26T19:30:47.439Z","repository":{"id":28000310,"uuid":"31494570","full_name":"yetone/script-manager","owner":"yetone","description":"An elegant command-line interface. Usage like Flask-Script but more powerful and universal.","archived":false,"fork":false,"pushed_at":"2019-12-02T08:55:46.000Z","size":24,"stargazers_count":5,"open_issues_count":0,"forks_count":0,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-01-30T17:02:34.250Z","etag":null,"topics":[],"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/yetone.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}},"created_at":"2015-03-01T11:26:17.000Z","updated_at":"2021-06-20T05:55:16.000Z","dependencies_parsed_at":"2022-08-03T05:30:17.879Z","dependency_job_id":null,"html_url":"https://github.com/yetone/script-manager","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yetone%2Fscript-manager","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yetone%2Fscript-manager/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yetone%2Fscript-manager/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yetone%2Fscript-manager/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/yetone","download_url":"https://codeload.github.com/yetone/script-manager/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":236595128,"owners_count":19174371,"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":[],"created_at":"2024-10-11T06:45:27.454Z","updated_at":"2025-10-26T19:30:42.165Z","avatar_url":"https://github.com/yetone.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"script-manager\n==============\n\n\n[![Build Status](https://scrutinizer-ci.com/g/yetone/script-manager/badges/build.png?b=master)](https://scrutinizer-ci.com/g/yetone/script-manager/build-status/master)\n[![Code Coverage](https://scrutinizer-ci.com/g/yetone/script-manager/badges/coverage.png?b=master)](https://scrutinizer-ci.com/g/yetone/script-manager/?branch=master)\n[![PyPI Package latest release](https://img.shields.io/pypi/v/script-manager.svg)](https://pypi.org/project/script-manager)\n[![PyPI Wheel](https://img.shields.io/pypi/wheel/script-manager.svg)](https://pypi.org/project/script-manager)\n\n\nAn elegant command-line interface. Usage like Flask-Script but more powerful and universal.\n\n\n# Install\n\n```shell\npip install script-manager\n```\n\n\n# Examples\n\nIf you create a `test.py` file like this:\n\n```python\nfrom typing import Optional, List\nfrom script_manager import Manager\n\nmanager = Manager('I am a command')\n\n\n@manager.command\ndef run(host: str = '127.0.0.1', port: int = 8080, hehe: Optional[List[int]] = None):\n    print('Running at http://{}:{}'.format(host, port))\n    if hehe is not None:\n        print(sum(hehe))\n\n\n@manager.command\ndef test(name, age):\n    \"\"\"Just print my information\n\n    :param name: This is my name\n    :param age: This is my age\n    \"\"\"\n    print('My name is {}, and I am {} years old.'.format(name, age))\n\n\nif __name__ == '__main__':\n    manager.run()\n```\n\nThen you can run command in shell:\n\n```shell\n➜ python test.py -h\nusage: test.py [-h] run test\n\nI am a command\n\npositional arguments:\n  run\n  test        Just print my information\n\noptional arguments:\n  -h, --help  show this help message and exit\n\n```\n\nand:\n\n```shell\n➜ python test.py run -h\nusage: test.py [-h] [-H HOST] [-p PORT] [--hehe HEHE]\n\noptional arguments:\n  -h, --help            show this help message and exit\n  -H HOST, --host HOST\n  -p PORT, --port PORT\n  --hehe HEHE\n\n```\n\nand:\n\n```shell\n➜ python test.py test -h\nusage: test.py [-h] name age\n\nJust print my information\n\npositional arguments:\n  name        This is my name\n  age         This is my age\n\noptional arguments:\n  -h, --help  show this help message and exit\n\n```\n\nand:\n\n```shell\n➜ python test.py run -H 0.0.0.0 -p 8888\nRunning at http://0.0.0.0:8888\n\n```\n\n```shell\n➜ python test.py run -H 0.0.0.0 -p 8888 --hehe 1 --hehe 2 --hehe 3\nRunning at http://0.0.0.0:8888\n6\n\n```\n\nand:\n\n```shell\n➜ python test.py test yetone 12\nMy name is yetone, and I am 12 years old.\n\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fyetone%2Fscript-manager","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fyetone%2Fscript-manager","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fyetone%2Fscript-manager/lists"}