Just another CLI library.
$ git clone https://github.com/Raisess/yacli
$ cd yacli
$ ./install.sh
$ yacli create my-cli
$ cd my-cli
All required files will be created by yacli
, just start editing my-cli/src/main.py
:
#! /usr/bin/env python3
from yacli import CLI, Command
class TestCommand(Command):
def __init__(self):
super().__init__("my-command", "description", args_len=0)
def handle(self, args: list[str]) -> None:
print("Hello, world!")
if __name__ == "__main__":
cli = CLI("my-cli", [TestCommand()])
cli.handle()
and run sudo my-cli/install.py
.
$ my-cli help
That's all!