hatch icon indicating copy to clipboard operation
hatch copied to clipboard

Add a new command with a plugin

Open ThmX opened this issue 2 years ago • 3 comments

Hi, Is it possible to add a new command from within a plugin?

Such as:

hatch custom-cmd abc

We recently migrated from poetry to hatch, and had our own plugin for poetry to manage custom things. And I would like hatch to be the base command where all the other commands are documented instead of having to create another program that would therefore wraps hatch commands.

ThmX avatar Mar 29 '23 08:03 ThmX

This is not yet possible but is a good idea. Thanks!

ofek avatar Mar 29 '23 14:03 ofek

This is not yet possible but is a good idea. Thanks!

I'll have a look and see if I can prepare a PR for it.

Any tips you can provide before I start deep diving? 😅 Most likely something with pluggy? And obviously I should stick to click?

Also: Any reason you used click instead of Typer to make use of type hinting?

ThmX avatar Mar 30 '23 11:03 ThmX

How about click-plugins for something like this?

juftin avatar Jan 30 '24 23:01 juftin