Skip to content

Raisess/yacli

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

15 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published