bakefile.py:
What just happened
MyBakebooksubclassesBakebook, so its methods become tasks. Tasks defined before instantiating use the@command()decorator on class methods.- Standalone functions work too. Attach them after instantiating with
@bakebook.command(). - Task arguments become typed CLI options.
name: str = "world"gives you--namewith a default, and--helpdocuments itself. self.ctx.run()executes real CLI commands through Python’s subprocess.console.echo()prints your task’s output.