Toast-cli follows a plugin-based architecture that makes it easy to extend and maintain.
Toast-cli Plugin Architecture (각 항목을 드래그하여 이동 가능)
toast-cli/
├── setup.py # Package setup script
├── setup.cfg # Package configuration
├── pyproject.toml # Build system requirements
├── MANIFEST.in # Additional files to include
├── VERSION # Version information (v3.2.0.dev0)
├── README.md # Project documentation
├── ARCHITECTURE.md # Architecture documentation
├── LICENSE # License information
├── docs/ # Documentation website files
│ ├── CNAME # Custom domain configuration
│ ├── favicon.ico # Website favicon
│ ├── index.html # Main documentation page
│ ├── css/ # Stylesheet files
│ ├── images/ # Documentation images
│ └── js/ # JavaScript files
└── toast/ # Main package
├── __init__.py # Package initialization and CLI entry point
├── __main__.py # Entry point for running as a module
├── helpers.py # Helper functions and custom UI elements
└── plugins/ # Plugin modules
├── __init__.py
├── base_plugin.py
├── am_plugin.py
├── cdw_plugin.py
├── ctx_plugin.py
├── dot_plugin.py
├── env_plugin.py
├── git_plugin.py
├── region_plugin.py
└── utils.py
To add a new plugin:
toast/plugins directoryBasePluginexecute and optionally get_arguments)name and help class variablesThe plugin will be automatically discovered and loaded when the application starts.
from toast.plugins.base_plugin import BasePlugin
import click
class MyPlugin(BasePlugin):
name = "mycommand"
help = "Description of my command"
@classmethod
def get_arguments(cls, func):
# Optional: Define command arguments
func = click.option("--option", "-o", help="An option for my command")(func)
return func
@classmethod
def execute(cls, **kwargs):
# Command implementation
option = kwargs.get("option")
if option:
click.echo(f"Executing with option: {option}")
else:
click.echo("My custom command execution")