Raisess / yacli

Just another CLI library.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Yet Another CLI

Just another CLI library.

Setup

$ git clone https://github.com/Raisess/yacli
$ cd yacli
$ ./install.sh

How to use?

Creating a new CLI:

$ 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.

Using your CLI:

$ my-cli help

That's all!

About

Just another CLI library.

License:MIT License


Languages

Language:Python 98.0%Language:Shell 2.0%