Metadata-Version: 2.3
Name: quickie-runner
Version: 0.1.0
Summary: A CLI tool for quick tasks.
Project-URL: Homepage, https://github.com/adrianmrit/quickie
Project-URL: Repository, https://github.com/adrianmrit/quickie.git
Project-URL: Issues, https://github.com/adrianmrit/quickie/issues
Project-URL: Changelog, https://github.com/adrianmrit/quickie/blob/main/CHANGELOG.md
Author-email: Author Name <author@example.com>
License: The MIT License
        
        Copyright 2024 Adrian Martinez Rodriguez <adrianmrit@gmail.com>
        
        Permission is hereby granted, free of charge, to any person obtaining a copy
        of this software and associated documentation files (the "Software"), to deal
        in the Software without restriction, including without limitation the rights
        to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
        copies of the Software, and to permit persons to whom the Software is
        furnished to do so, subject to the following conditions:
        
        The above copyright notice and this permission notice shall be included in
        all copies or substantial portions of the Software.
        
        THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
        IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
        FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
        AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
        LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
        OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
        THE SOFTWARE.
License-File: LICENSE
Keywords: CLI,quick,tasks
Classifier: Development Status :: 3 - Alpha
Classifier: Environment :: Console
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: MIT License
Classifier: Programming Language :: Python :: 3.12
Requires-Python: >=3.12
Requires-Dist: argcomplete~=3.5.0
Requires-Dist: classoptions~=0.2.0
Requires-Dist: frozendict~=2.4.4
Requires-Dist: oslex~=0.1.3
Requires-Dist: python-dotenv~=1.0.1
Requires-Dist: rich~=13.7.1
Provides-Extra: dev
Requires-Dist: mock; extra == 'dev'
Requires-Dist: pytest; extra == 'dev'
Requires-Dist: pytest-cov; extra == 'dev'
Requires-Dist: pytest-mock; extra == 'dev'
Description-Content-Type: text/markdown

# Quickie - A CLI tool for quick tasks

[![License](https://img.shields.io/github/license/adrianmrit/quickie)](https://github.com/adrianmrit/quickie/blob/master/LICENSE)

## Getting Started

### Prerequisites

Some prerequisites need to be installed.

- Python 3.12+

### Installing

The recommended way to install `quickie` is via `pipx`.

With `pipx` you can add the `qck` command and the package in an isolated environment, without polluting your global Python environment.

See the [pipx installation instructions](https://pipx.pypa.io/stable/installation/)

After installing `pipx`, you can install `quickie` with the following command:

```sh
pipx install quickie-runner
```

You can also install `quickie` with `pip`:

```sh
pip install quickie-runner
```

## Tab completion

Tab completion is available for bash and zsh. It depends on the `argcomplete` package, which should have been installed with `quickie`.

To enable tab completion for `quickie`, add the following line to your `.bashrc` or `.zshrc`:

```sh
eval "$(register-python-argcomplete qck)"
```

If you get the following error in the zsh shell:

```sh
complete:13: command not found: compdef
```

You can fix it by adding the following line to your `.zshrc` (before the line that registers the completion):

```sh
autoload -Uz compinit && compinit
```

## Usage

Tasks are configured under a `__quickie.py` or `__quickie` python module in the current directory.
If using a `__quickie` directory, the tasks are defined in the `__quickie/__init__.py` file.

Tasks are defined as classes, though factory functions are also supported.

### Why define tasks in Python?

While many existing similar tools use YAML, TOML or custom formats to define tasks, `quickie` uses Python for the following reasons:

- Built-in syntax highlighting and linting
- Supported by most editors and IDEs
- Easy to use and understand
- Extensible and powerful

### Quick Example

Here is a simple example of a `__quickie.py` file:

```python
from quickie.tasks import Task, ScriptTask

class hello(Task):
    def run(self):
        print("Hello, world!")


class ScriptTaskExample(ScriptTask):
    class Meta:
        alias = "echo"
        allow_unknown_args = True

    def get_script(self, *args):
        return " ".join(["echo", *args])
```

You can run the `Hello` task with the following command:

```sh
qck hello
```

And the `ScriptTaskExample` task with:

```sh
qck echo "Hello, world!"
```
