Use this repository as a GitHub template to add a new command to brkraw via
the brkraw.cli entry point group. Extensions own their feature dependencies,
keeping the core brkraw install minimal and the maintenance surface small.
pip install -e .
brkraw foo --helpUpdate these locations to match your extension:
pyproject.toml: updatename,version, and the entry point key under[project.entry-points."brkraw.cli"].src/brkraw_cli_addon/: rename this package folder and update references (e.g.,src/my_addon/andmy_addon.plugin:register).src/brkraw_cli_addon/plugin.py: rename the command fromfoo(or any placeholder) and adjust help/description text.src/brkraw_cli_addon/__init__.py: keep the version in sync.
Example entry point after renaming:
[project.entry-points."brkraw.cli"]
mycmd = "my_addon.plugin:register"brkraw loads entry points in the brkraw.cli group. Each entry point must
resolve to a callable with this signature:
def register(subparsers: argparse._SubParsersAction) -> None:
...Inside register, define your subcommand and attach a handler:
parser.set_defaults(_handler=handler_func)pyproject.toml: packaging metadata and entry point configurationsrc/brkraw_cli_addon/plugin.py: CLI registration and command logicsrc/brkraw_cli_addon/__init__.py: version marker
pip install -e .
brkraw foo "hello from my extension"