Metadata-Version: 2.4
Name: bykcli-plugin
Version: 1.0.0a5
Summary: Plugin infrastructure for bykcli
Author-email: fcbyk <731240932@qq.com>
License: MIT
Classifier: Development Status :: 3 - Alpha
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: MIT License
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Requires-Python: >=3.10
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: click>=8.0.0
Requires-Dist: bykcli<2.0,>=1.0.0a5
Provides-Extra: test
Requires-Dist: pytest<8.0.0,>=7.0.0; extra == "test"
Requires-Dist: pytest-cov<5.0.0,>=4.0.0; extra == "test"
Provides-Extra: build
Requires-Dist: commitizen; extra == "build"
Requires-Dist: build; extra == "build"
Requires-Dist: twine; extra == "build"
Dynamic: license-file

# bykcli-plugin

[![Python](https://img.shields.io/badge/python-%E2%89%A53.10-blue?logo=python&logoColor=white)](https://www.python.org/downloads/)
[![Tests](https://github.com/fcbyk/bykcli/actions/workflows/test.yml/badge.svg)](https://github.com/fcbyk/bykcli/actions/workflows/test.yml)
[![Coverage](https://codecov.io/gh/fcbyk/bykcli/branch/main/graph/badge.svg)](https://codecov.io/gh/fcbyk/bykcli)
[![License](https://img.shields.io/github/license/fcbyk/bykcli.svg)](https://github.com/fcbyk/bykcli/blob/main/LICENSE)

Plugin infrastructure for [bykcli](https://github.com/fcbyk/bykcli).

## Install

```bash
pip install bykcli-plugin
```

## Usage

Implement `PluginProtocol` and register your commands:

```python
# my_plugin.py
import click
from bykcli import PluginProtocol

class MyPlugin(PluginProtocol):
    commands = {"hello": "say hello"}

    def register(self, cli: click.Group) -> None:
        @cli.command()
        @click.pass_context
        def hello(ctx):
            click.echo("Hello from my plugin!")
```

## API

- **PluginProtocol** — class-based plugin registration protocol
- **CommandContext / pass_command_context / get_app_context** — command runtime context
- **PathItem / PathProvider / register_path_provider** — path management
- **get_private_networks / ensure_port_available** — network utilities
- **StateStore** — persistent key-value storage per command

## License

MIT
