Skip to main content

A CLI tool for quick tasks.

Project description

Quickie - A CLI tool for quick tasks

License

Getting Started

Installing

Quickie can be installed either on a per-project basis and globally.

For projects it is recommended to use a virtual environment and install via pip:

```sh
python -m venv .venv
source .venv/bin/activate
pip install quickie-runner
qck --help
```

For global installation, you can install Quickie with the global option. In addition to adding the qck executable to your path, it will also add a qckg executable, which will run global tasks by default. This allows us to run our global tasks from any project without conflicts.

For global installation it is recommended to use pipx, as it will install Quickie in an isolated environment:

```sh
pipx install quickie-runner[global]
qck --help
qckg --help
```

See the pipx

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)"
eval "$(register-python-argcomplete qckg)"
```

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

Per-project tasks are configured under a __quickie.py or __quickie python module in the current directory. If using a __quickie directory, the tasks should be defined in the __quickie/__init__.py file.

Global tasks on the other hand should be defined in the Quickie module in the user's directory.

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 import arg, script, task

@task(name=["hello", "greet"])
@arg("name", help="The name to greet")
def hello(name):
    """Greet someone"""  # added as the task help
    print(f"Hello, {name}!")


@script(extra_args=True, help="Echo the given arguments")
def echo():
    return " ".join(["echo", *args])
```

You can run the hello task with the following command:

```sh
$ qck hello world
Hello, world!
$ qck greet world
Hello, world!
```

And the script task with:

```sh
$ qck echo Hello there
Hello there
```

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

quickie_runner-0.2.0.tar.gz (29.8 kB view details)

Uploaded Source

Built Distribution

quickie_runner-0.2.0-py3-none-any.whl (28.7 kB view details)

Uploaded Python 3

File details

Details for the file quickie_runner-0.2.0.tar.gz.

File metadata

  • Download URL: quickie_runner-0.2.0.tar.gz
  • Upload date:
  • Size: 29.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.12.4

File hashes

Hashes for quickie_runner-0.2.0.tar.gz
Algorithm Hash digest
SHA256 3416607d1a6df86fc12488faaac4a982b92d729a585cf36572def90d9d7e1143
MD5 d747e149cbf4e8ff69baffb363d01804
BLAKE2b-256 037759b3fed7981ca544b078808f310ed2ea358a77607a1965539afa928c85d2

See more details on using hashes here.

File details

Details for the file quickie_runner-0.2.0-py3-none-any.whl.

File metadata

File hashes

Hashes for quickie_runner-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 28f797f6034931628c03fcc6a40743b029f7a4794347ce10f48c0680cdb64c47
MD5 5c50aa6c072d430a0b56eea899ebbf40
BLAKE2b-256 be3b134ed407049469c9bd836f37e7b6c452b1c66ba9318a8e50e2cf69106781

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page