A CLI tool for quick tasks.
Project description
Quickie - A CLI tool for quick tasks
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
After installing pipx
, you can install quickie
with the following command:
pipx install quickie-runner
You can also install quickie
with pip
:
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
:
eval "$(register-python-argcomplete qck)"
If you get the following error in the zsh shell:
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):
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:
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:
qck hello
And the ScriptTaskExample
task with:
qck echo "Hello, world!"
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
Built Distribution
File details
Details for the file quickie_runner-0.1.0.tar.gz
.
File metadata
- Download URL: quickie_runner-0.1.0.tar.gz
- Upload date:
- Size: 17.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.12.4
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 6a4eb21945d88b73104229994f92088136cd7994c7238d10627596d717cde65e |
|
MD5 | d57330193be8cae3d5e8a767e5878d76 |
|
BLAKE2b-256 | 6f7a7000f68edfff4c1d4559b88f1c4c799fae7b7e4cfafd613383f22ff40640 |
File details
Details for the file quickie_runner-0.1.0-py3-none-any.whl
.
File metadata
- Download URL: quickie_runner-0.1.0-py3-none-any.whl
- Upload date:
- Size: 18.8 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.12.4
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 613eef84181a8ef3926318aa9b9ca42169e3561b80a63c06e0cb8373889d5015 |
|
MD5 | 10e30d10621e985637648517ca6f398d |
|
BLAKE2b-256 | 4c682621abd94f4d63116b972034ae8bdd2e20389c1fee35a79124589ca6e203 |