Metadata-Version: 2.1
Name: cli-lite
Version: 0.1.0
Summary: A simple framework to build a cli tool, base on Alconna
Home-page: https://github.com/RF-Tar-Railt/cli-lite
Author: RF-Tar-Railt
Author-email: rf_tar_railt@qq.com
License: MIT
Project-URL: Bug Reports, https://github.com/RF-Tar-Railt/cli-lite/issues
Project-URL: Source, https://github.com/RF-Tar-Railt/cli-lite
Keywords: commandline,cli-tool,plugin,cli,litecli
Platform: UNKNOWN
Classifier: Development Status :: 4 - Beta
Classifier: License :: OSI Approved :: MIT License
Classifier: Programming Language :: Python :: 3.8
Classifier: Programming Language :: Python :: 3.9
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Operating System :: OS Independent
Requires-Python: >=3.8
Description-Content-Type: text/rst
License-File: LICENSE
Requires-Dist: arclet-alconna (>=1.0.4)

Lite-Cli
========

A simple framework to build a cli tool. Base on
```Alconna`` <https://github/ArcletProject/Alconna>`__

install
-------

.. code:: powershell

   pip install cli-lite

example
-------

write as sample:

.. code:: python

   from clilte import BasePlugin, CommandLine, PluginMetadata
   from arclet.alconna import Alconna, Arpamar, Args

   class MyPlugin(BasePlugin):
       
       def _init_command(self) -> Alconna:
           return Alconna("hello", Args["name", str])

       def dispatch(self, result: Arpamar):
           return print(f"Hello! {result.name}")

       def meta(self) -> PluginMetadata:
           return {"name": "hello", "description": "my first plugin", "author": ["john"], "tags": ["dev"], "version": "0.0.1"}

   if __name__ == '__main__':
       cli = CommandLine("test", "My first CLI", "0.0.1")
       cli.add(MyPlugin)
       cli.main(load_preset=True)

and execute the line:

.. code:: powershell

   python test.py hello world


