https://github.com/lggruspe/genbu
Create composable CLIs using shell args parser combinators and type hints
https://github.com/lggruspe/genbu
cli combinators command-line hints infer parser python type
Last synced: 22 days ago
JSON representation
Create composable CLIs using shell args parser combinators and type hints
- Host: GitHub
- URL: https://github.com/lggruspe/genbu
- Owner: lggruspe
- License: mit
- Created: 2021-02-01T17:44:51.000Z (about 5 years ago)
- Default Branch: main
- Last Pushed: 2021-07-04T08:57:41.000Z (almost 5 years ago)
- Last Synced: 2026-01-14T09:29:24.341Z (3 months ago)
- Topics: cli, combinators, command-line, hints, infer, parser, python, type
- Language: Python
- Homepage:
- Size: 140 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
Awesome Lists containing this project
README
genbu
=====

[](https://pypi.org/project/genbu/)
[](https://pypi.org/project/genbu/)
[](./LICENSE)
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
-------
```bash
pip install genbu
```
Usage
-----
```python
# hello.py
from genbu import Genbu
print(Genbu(lambda name: f"Hello, {name}!").run())
# Usage example: python hello.py --name "world"
```
See [examples](./examples/).
License
-------
[MIT](./LICENSE)