Skip to main content

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 a register 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

Publishing Plugins

You can publish your plugins to npm to share them with the community:
Users can then install your plugin globally or locally: