Plugins
The Zopio CLI supports a powerful plugin system that allows you to extend its functionality with custom commands and features.Using Plugins
Plugins are automatically loaded from the.zopio/plugins
directory in your project. You can also specify additional plugin directories using the ZOPIO_PLUGINS_DIR
environment variable.
Creating Plugins
A Zopio CLI plugin is a TypeScript module that exports aregister
function. This function receives the CLI instance and can register new commands or modify existing ones.
Basic Plugin Structure
Plugin Configuration
Plugins can include a configuration file that defines metadata and dependencies:Example Plugins
Hooks
Plugins can also register hooks to extend or modify the behavior of existing commands:Available Hooks
Hook | Description |
---|---|
pre:init | Before project initialization |
post:init | After project initialization |
pre:generate | Before generating a module |
post:generate | After generating a module |
pre:crud | Before generating CRUD operations |
post:crud | After generating CRUD operations |
pre:job | Before creating a job |
post:job | After creating a job |