clickwork¶
Reusable CLI framework for project automation.
clickwork gives you a one-file cli.py that auto-discovers commands
from a local directory AND from installed plugins, with type-safe
config, structured logging, and subprocess helpers that handle signals
correctly. It's the framework half of "should I just make a CLI for
this?" so you can focus on the commands themselves.
Install¶
Requires Python 3.11+.
Three ways in¶
Start with the Quickstart — install to first working command in about 5 minutes. Then the Practical Walkthrough takes you through building a realistic small CLI with a local command and an installed plugin.
The How-To section has recipes for common tasks — taming an out-of-control script dir, adding a command, writing a plugin, migrating from argparse.
The Reference section has the full User Guide, plugin spec, security model, migration notes, an auto-generated API reference, and an LLM-oriented reference for use with coding assistants.
Why clickwork¶
- Data-driven discovery. Drop a
cli.py-shaped file into yourcommands/directory; it shows up. Install a plugin that ships commands; they show up too. Local wins on collision. - Typed config, not string juggling.
ConfigErrorwhen a key is missing or mistyped, with the file path and key name in the message. - Signals done right. Subprocess helpers forward
SIGINTand escalate toSIGKILLon timeout. You don't lose half a pipeline to a Ctrl-C that got eaten. - Typed all the way down.
py.typedmarker ships in the wheel;mypy --strictpasses on clickwork's own tree.
Project links¶
- Source on GitHub
- Issues + roadmap
- Changelog
- Public API policy — what the semver promise covers, and what it doesn't.