fonk: pyproject.toml based task runner
Project description
🔥 Fonk 🔥
Fonk is an open-source command runner that is fully configured via pyproject.toml.
Usage
First add an entry into your pyproject.toml file that contains the command you want to run:
[tool.fonk.command.my_command]
description = "Run my command"
arguments = ["echo", "Hello, World!"]
type = "shell"
Then run the command using the following command:
uvx fonk my_command
Flags
You can define flags for your command. For example, to define a flag that changes the output of your command:
[tool.fonk]
flags = [
{ name = "love", shorthand = "l", description = "Show love" }
]
[tool.fonk.command.my_command]
description = "Run my command"
arguments = ["echo", "Hello, World!"]
type = "shell"
flags = [
{ on = "love", remove = ["Hello, World!"], add = ["I love you, World!"] }
]
Then run the command with the flag:
uvx fonk my_command --love
You'll note that we had to add the flag in the flags table as well as in the command table. This is because the flag is a global flag that can be used with any command. The on field in the flag table specifies the flag that the command should listen to. The remove field specifies the arguments that should be removed when the flag is used. The add field specifies the arguments that should be added when the flag is used.
There are a number of built in flags that change the behaviour of fonk itself, but can also affect your commands. These are:
--helpor-h: Shows the help message for the command. Cannot reach your command.--quietor-q: Runs the command in quiet mode, which suppresses all output.--verboseor-v: Runs the command in verbose mode, which shows all output.--fail-quickor-x: Stops the command as soon as an error is encountered.--concurrentor-j: Runs the command concurrently.
Contributing
We welcome contributions from the community. To contribute to Fonk, follow these steps:
- Fork the repository.
- Create a new branch (
git checkout -b feature-branch). - Make your changes.
- Commit your changes (
git commit -m 'feat: Add new feature'). - Push to the branch (
git push origin feature-branch). - Open a pull request.
Please ensure your code adheres to our coding standards. Since this is a task runner, the required CI steps are also defined as Fonk commands in the pyproject.toml file. Simply use uv run fonk to run all steps.
License
Fonk is licensed under the MIT License. See the LICENSE file for more details.
Contact
For any questions or feedback, please open an issue on the GitHub repository.
Project details
Release history Release notifications | RSS feed
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
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file fonk-0.1.2.tar.gz.
File metadata
- Download URL: fonk-0.1.2.tar.gz
- Upload date:
- Size: 61.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: uv/0.5.24
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
21dff59605b6ddb9c85c386247f61ae5ea8f44827127c4d56ce0d202d094e92e
|
|
| MD5 |
b52f7a696da315e1e365e43274872eb0
|
|
| BLAKE2b-256 |
75d1d6fb0ea2da51ca0c695162c1235ab05875e27d0392a4ab22055f85aecd39
|
File details
Details for the file fonk-0.1.2-py3-none-any.whl.
File metadata
- Download URL: fonk-0.1.2-py3-none-any.whl
- Upload date:
- Size: 11.8 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: uv/0.5.24
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
b4a775f37ce82eb718eea7efe68ab35e64ba31a3fe301f353fb784a9ee27ac34
|
|
| MD5 |
c5e9f7d3e690d804d552d9373d7c09ac
|
|
| BLAKE2b-256 |
e617d1d70b33b7201ef9022bb8bf68a4e6d56f21a97bed6c310088d47a1aef1d
|