Command Line Interface (CLI) entry point for honeybee and honeybee extensions.
Use this file only to add command related to honeybee-core. For adding extra commands from each extention see below.
Do not import this module in your code directly unless you are extending the command
line interface. For running the commands execute them from the command line or as a
Honeybee is using click (https://click.palletsprojects.com/en/7.x/) for creating the CLI. You can extend the command line interface from inside each extention by following these steps:
cli.pyfile in your extension.
mainfunction from this
Add your commands and command groups to main using add_command method.
__init__.pyfile to the commands are added to the cli when the module is loaded.
The good practice is to group all your extention commands in a command group named after
the extension. This will make the commands organized under extension namespace. For
instance commands for honeybee-radiance will be called like
honeybee radiance [radiance-command].
import click from honeybee.cli import main @click.group() def radiance(): pass # add commands to radiance group @radiance.command('daylight-factor') # ... def daylight_factor(): pass # finally add the newly created commands to honeybee cli main.add_command(radiance) # do not forget to import this module in __init__.py otherwise it will not be added # to honeybee commands.
For extension with several commands you can use a folder structure instead
of a single file. Refer to
honeybee-radiance for an example.