Metadata-Version: 2.1
Name: cx-tool
Version: 0.1.0.29
Summary: Crossover utility tool
License: MIT
Author: Yurzs
Author-email: me@yurzs.dev
Requires-Python: >=3.10
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
Requires-Dist: click (>=8.1.7,<9.0.0)
Requires-Dist: plumbum (>=1.8.3,<2.0.0)
Requires-Dist: pydantic (>=2.9.2,<3.0.0)
Requires-Dist: pytz (>=2024.2,<2025.0)
Requires-Dist: rich (>=13.8.1,<14.0.0)
Requires-Dist: typing-extensions (>=4.12.2,<5.0.0)
Requires-Dist: vdf (>=3.4,<4.0)
Description-Content-Type: text/markdown

# CX-tool

This is a collection of utility functions that I have written over the years. I have decided to put them all in one place so that I can easily access them. I have also included a few utility functions that I have found useful from other sources.

## Installation

```bash
pip install --user cx-tool
```

## Usage

```zsh
cx-tool install
```

## Write your own plugin

You can add your own plugin that performs a specific task. To do this, you need to create a new Python file in the `plugins` directory. The file should contain a class that inherits from the `Plugin` class. 

To add click command use the 

```python
import click

from crossover_util.plugin.plugin import Plugin, clickable
from crossover_util.plugin.context import PluginContext


class MyPlugin(Plugin):
    name = "my-plugin"

    @clickable
    def hello(self):
        click.echo("Hello, World!")
    
    def on_load(self):
        """This method is called when the plugin is loaded.
            
        Here you can add any initialization code that you need.
        """

        self.cli_command("hello")(self.hello)

    def on_start(self, ctx: PluginContext):
        """This method is called when the CrossOver app is started.

        Here you can add env variables and arguments to CrossOver app.
        """

        ctx.environment["HELLO"] = "WORLD"
```

To access `hello` click subcommand command use the following command

```zsh
cx-tool my-plugin hello
```

