Metadata-Version: 2.4
Name: pycli2
Version: 0.1.9
Summary: Python library to auto parse command line args from function typing.
Author-email: Osvald Lindholm <osvald.lindholm@gmail.com>
License-Expression: GPL-3.0-only
Project-URL: source, https://github.com/Olindholm/pycli2.git
Keywords: cli,command,line,arg,interface,parse,typing
Requires-Python: >=3.10
Description-Content-Type: text/markdown
License-File: LICENSE.md
Requires-Dist: pydantic<3,>=2.1; python_version <= "3.12"
Requires-Dist: pydantic<3,>=2.8; python_version == "3.13"
Requires-Dist: pydantic<3,>=2.12; python_version >= "3.14"
Provides-Extra: dev
Requires-Dist: pytest==8.4.2; extra == "dev"
Requires-Dist: pytest-asyncio==1.2.0; extra == "dev"
Requires-Dist: ruff==0.14.4; extra == "dev"
Requires-Dist: pytest-ruff==0.5; extra == "dev"
Requires-Dist: mypy==1.18.2; extra == "dev"
Requires-Dist: pytest-mypy==1.0.1; extra == "dev"
Requires-Dist: types-setuptools==80.9.0.20250822; extra == "dev"
Requires-Dist: setuptools==80.9.0; extra == "dev"
Requires-Dist: semver==3.0.4; extra == "dev"
Dynamic: license-file

# PyCLI2

Python library to auto parse command line args from function typing.

# Overview

This package simplfies the creation of CLI apps, by analysing the typing of python functions and
parsing command line arguments.

# Installation

The python package, both wheel and source distribution is available at
[PyPI pycli2 project](https://pypi.org/project/pycli2/). Install using your python package manager
of choice. E.g. pip.
```sh
pip install pycli2
```

# Usage

The package comes with a demo CLI, which the source can be view at
[src/pycli2/\_\_main\_\_.py](src/pycli2/__main__.py). It can be accessed by running
```sh
python -m pycli --help
```

In order to make your own CLI, simply import `pycli2` and use the `pycli2.run` function.
Provide it with functions, and it'll automatically create a CLI app from the function
typing and function docstring.

```python
import pycli2

if __name__ == "__main__":
    # This will expose firstfunc, secondfunc, and thirdfunc to the CLI.
    pycli2.run(
        firstfunc,
        secondfunc,
        thirdfunc,
    )
```

# Contributing

...

# License

This project is licensed under the [GNU General Public License v3.0 only](LICENSE.md).
