cli-lite


Namecli-lite JSON
Version 0.11.2 PyPI version JSON
download
home_pageNone
SummaryA simple framework to build a cli tool, base on Alconna
upload_time2025-08-25 03:31:46
maintainerNone
docs_urlNone
authorNone
requires_python>=3.9
licenseMIT
keywords commandline cli-tool plugin cli litecli
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # Cli-Lite

A simple framework to build a cli tool. Base on [`Alconna`](https://github.com/ArcletProject/Alconna)

## install

```shell
pip install cli-lite
```

## example

write as sample:

```python
# example.py
from clilte import BasePlugin, CommandLine, PluginMetadata
from arclet.alconna import Alconna, Arparma, Args, CommandMeta, Option


class MyPlugin(BasePlugin):

    def init(self) -> Alconna | str:
        return Alconna("hello", Args["name", str], meta=CommandMeta("test command"))

    def meta(self) -> PluginMetadata:
        return PluginMetadata("hello", "0.0.1", "my first plugin", ["dev"], ["john"])

    def dispatch(self, result: Arparma) -> bool | None:
        return print(f"Hello! {result.name}")

    @classmethod
    def supply_options(cls) -> list[Option] | None:
        return 


if __name__ == '__main__':
    cli = CommandLine(title="My first CLI", version="example 0.0.1")
    cli.add(MyPlugin)
    cli.main()
```

and execute the line:

```shell
python example.py hello world
```

you will get the result:

```shell
Hello! world
```


            

Raw data

            {
    "_id": null,
    "home_page": null,
    "name": "cli-lite",
    "maintainer": null,
    "docs_url": null,
    "requires_python": ">=3.9",
    "maintainer_email": null,
    "keywords": "commandline, cli-tool, plugin, cli, litecli",
    "author": null,
    "author_email": "RF-Tar-Railt <rf_tar_railt@qq.com>",
    "download_url": "https://files.pythonhosted.org/packages/98/4a/dee4481fb873b7c16c0466ff4209b870304575fe4814242aa35824ff4ee3/cli_lite-0.11.2.tar.gz",
    "platform": null,
    "description": "# Cli-Lite\n\nA simple framework to build a cli tool. Base on [`Alconna`](https://github.com/ArcletProject/Alconna)\n\n## install\n\n```shell\npip install cli-lite\n```\n\n## example\n\nwrite as sample:\n\n```python\n# example.py\nfrom clilte import BasePlugin, CommandLine, PluginMetadata\nfrom arclet.alconna import Alconna, Arparma, Args, CommandMeta, Option\n\n\nclass MyPlugin(BasePlugin):\n\n    def init(self) -> Alconna | str:\n        return Alconna(\"hello\", Args[\"name\", str], meta=CommandMeta(\"test command\"))\n\n    def meta(self) -> PluginMetadata:\n        return PluginMetadata(\"hello\", \"0.0.1\", \"my first plugin\", [\"dev\"], [\"john\"])\n\n    def dispatch(self, result: Arparma) -> bool | None:\n        return print(f\"Hello! {result.name}\")\n\n    @classmethod\n    def supply_options(cls) -> list[Option] | None:\n        return \n\n\nif __name__ == '__main__':\n    cli = CommandLine(title=\"My first CLI\", version=\"example 0.0.1\")\n    cli.add(MyPlugin)\n    cli.main()\n```\n\nand execute the line:\n\n```shell\npython example.py hello world\n```\n\nyou will get the result:\n\n```shell\nHello! world\n```\n\n",
    "bugtrack_url": null,
    "license": "MIT",
    "summary": "A simple framework to build a cli tool, base on Alconna",
    "version": "0.11.2",
    "project_urls": {
        "Bug Reports": "https://github.com/RF-Tar-Railt/cli-lite/issues",
        "Homepage": "https://github.com/RF-Tar-Railt/cli-lite",
        "Source": "https://github.com/RF-Tar-Railt/cli-lite"
    },
    "split_keywords": [
        "commandline",
        " cli-tool",
        " plugin",
        " cli",
        " litecli"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "b4f6c4b16d59a7363638c46cb2b88a6a8209124b8212970482b5490a8343bfdd",
                "md5": "9014d66f75eea55a840d662872a7010a",
                "sha256": "48a8992fff4994779fb0dcf5596f077c2e684dcf528e453b068e164055d7fddc"
            },
            "downloads": -1,
            "filename": "cli_lite-0.11.2-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "9014d66f75eea55a840d662872a7010a",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.9",
            "size": 8243,
            "upload_time": "2025-08-25T03:31:45",
            "upload_time_iso_8601": "2025-08-25T03:31:45.232478Z",
            "url": "https://files.pythonhosted.org/packages/b4/f6/c4b16d59a7363638c46cb2b88a6a8209124b8212970482b5490a8343bfdd/cli_lite-0.11.2-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "984adee4481fb873b7c16c0466ff4209b870304575fe4814242aa35824ff4ee3",
                "md5": "d40ec3a39637c31026ab0b417c87f326",
                "sha256": "0ecc8d1b3f0b979f625e3c20cab800cd8a9b4c68bee1acfc1bfdf7142d284009"
            },
            "downloads": -1,
            "filename": "cli_lite-0.11.2.tar.gz",
            "has_sig": false,
            "md5_digest": "d40ec3a39637c31026ab0b417c87f326",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.9",
            "size": 7056,
            "upload_time": "2025-08-25T03:31:46",
            "upload_time_iso_8601": "2025-08-25T03:31:46.711530Z",
            "url": "https://files.pythonhosted.org/packages/98/4a/dee4481fb873b7c16c0466ff4209b870304575fe4814242aa35824ff4ee3/cli_lite-0.11.2.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2025-08-25 03:31:46",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "RF-Tar-Railt",
    "github_project": "cli-lite",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": false,
    "lcname": "cli-lite"
}
        
Elapsed time: 2.02757s