A plugin for managing other plugins in the Hiero CLI system.
This plugin provides functionality to add, remove, list, and get information about plugins in the system. All commands return structured CommandExecutionResult with both JSON and human-readable output formats.
Add a new plugin to the system from a plugin directory path.
Options:
--path, -p(required): Filesystem path to the plugin directory containingmanifest.js
Example:
hcli plugin-management add --path ./dist/plugins/my-pluginRemove a plugin from the system.
Options:
--name, -n(required): Name of the plugin to remove
Example:
hedera plugin-management remove --name my-pluginList all available plugins in the system.
Example:
hedera plugin-management listGet detailed information about a specific plugin.
Options:
--name, -n(required): Name of the plugin to get information about
Example:
hedera plugin-management info --name accountEnable a plugin that exists in the plugin-management state.
Options:
--name, -n(required): Name of the plugin to enable
Example:
hedera plugin-management enable --name accountDisable a plugin that exists in the plugin-management state.
Options:
--name, -n(required): Name of the plugin to disable
Example:
hcli plugin-management disable --name accountAll commands support both JSON and human-readable output formats:
- JSON: Structured data for programmatic use
- Human-readable: Formatted text for terminal display
All commands return structured output through the CommandExecutionResult interface:
interface CommandExecutionResult {
status: 'success' | 'failure';
errorMessage?: string; // Present when status !== 'success'
outputJson?: string; // JSON string conforming to the output schema
}Output Structure:
- Command Handlers: Return
CommandExecutionResultobjects - Output Schemas: Defined using Zod for validation and type safety
- Templates: Handlebars templates for human-readable output
- Error Handling: Consistent error handling across all commands
The outputJson field contains a JSON string that conforms to the Zod schema defined in each command's output.ts file, ensuring type safety and consistent output structure.
src/plugins/plugin-management/
├── commands/
│ ├── add/
│ │ ├── handler.ts # Command handler
│ │ ├── output.ts # Output schema and template
│ │ └── index.ts # Export
│ ├── remove/
│ │ ├── handler.ts
│ │ ├── output.ts
│ │ └── index.ts
│ ├── list/
│ │ ├── handler.ts
│ │ ├── output.ts
│ │ └── index.ts
│ └── info/
│ ├── handler.ts
│ ├── output.ts
│ └── index.ts
├── schema.ts # Shared data schemas
├── manifest.ts # Plugin manifest
├── index.ts # Main exports
└── README.md # This file
- All handlers return
CommandExecutionResultobjects - Output schemas are defined using Zod for runtime validation
- Human-readable templates use Handlebars syntax
- Mock data is used for demonstration purposes
- Real implementation would integrate with the plugin manager service