Skip to content
/ genbu Public

Create composable CLIs using shell args parser combinators and type hints

License

Notifications You must be signed in to change notification settings

lggruspe/genbu

Repository files navigation

genbu

GitHub Workflow Status PyPI PyPI - Python Version GitHub

Genbu is a library for creating composable command-line interfaces.

Features

  • Infer shell arguments parser from type hints.
  • Override inferred parsers using shell parser combinators.
  • Compose command-line interfaces declaratively (subcommands).
  • Dispatch automatically to the appropriate command callback.
  • Generate usage messages by using genbu.usage.

Install

pip install genbu

Usage

# hello.py
from genbu import Genbu

print(Genbu(lambda name: f"Hello, {name}!").run())
# Usage example: python hello.py --name "world"

See examples.

License

MIT

About

Create composable CLIs using shell args parser combinators and type hints

Topics

Resources

License

Stars

Watchers

Forks

Languages