https://github.com/d3f0/invoke-toolkit
A set of API extension to Invoke API to enhance CLI writing
https://github.com/d3f0/invoke-toolkit
Last synced: about 1 month ago
JSON representation
A set of API extension to Invoke API to enhance CLI writing
- Host: GitHub
- URL: https://github.com/d3f0/invoke-toolkit
- Owner: D3f0
- License: mit
- Created: 2024-08-02T08:18:04.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2025-07-04T14:03:56.000Z (7 months ago)
- Last Synced: 2025-08-16T21:38:48.314Z (6 months ago)
- Language: Python
- Size: 103 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 6
-
Metadata Files:
- Readme: README.md
- License: LICENSE.txt
Awesome Lists containing this project
README
# invoke-toolkit
A set of extensions for rich output, more options in collection/config discovery through `entry-points`.
This extends the Collection from Invoke so it can create automatically collections.
[](https://pypi.org/project/invoke-toolkit)
[](https://pypi.org/project/invoke-toolkit)
-----
## Table of Contents
- [invoke-toolkit](#invoke-toolkit)
- [Table of Contents](#table-of-contents)
- [Features](#features)
- [Do I need this package](#do-i-need-this-package)
- [Installation](#installation)
- [Development](#development)
- [License](#license)
## Features
- Task discovery by namespace for extendable/composable CLIs
- Discovery to *plain old* tasks.py (or any other name)
- Local tasks discovery from `local_tasks.py` in the current directory
- Integration with stand alone binaries for specific tasks
- **Future** Download binaries
## Do I need this package
If you have...
- Used `invoke` for a while and...
- Have a large `tasks.py` that needs to be modularized
- Have a lot of copy/pasted code in multiple `tasks.py` across multiple repos.
- Have exceeded the approach of a repository cloned as `~/tasks/` with more .py files that you want to manage.
- Or you want to combine various tasks defined in multiple directories
- You want to create a zipped (shiv) redistribute script for container environments
like Kubernetes based CI environments with only requiring the Python interpreter.
## Installation
```console
pip install invoke-toolkit
```
## Quick Start
### Using Local Tasks
Create a `local_tasks.py` file in your project directory with your tasks:
```python
from invoke_toolkit import task
@task()
def my_task(ctx):
"""Do something useful"""
print("Hello from local tasks!")
```
Then run it with:
```console
intk local.my-task
```
Local tasks are automatically discovered and added to the `local` namespace, allowing you to keep project-specific tasks separate from your main task collection.
## Development
This project utilizes the `pre-commit` framework, make sure you run:
`pre-commit install`
With `uvx`:
`uvx --with pre-commit-uv pre-commit install`
## License
`invoke-toolkit` is distributed under the terms of the [MIT](https://spdx.org/licenses/MIT.html) license.