Error Plugin
The Error Plugin provides intelligent error handling for CLI applications built with Wizard. It automatically detects command not found errors and suggests similar commands using fuzzy matching, making your CLI more user-friendly.
Installation
npm install @hyperse/wizard-plugin-error
Quick Start
cli.ts
import { createWizard } from '@hyperse/wizard';
import { createErrorPlugin } from '@hyperse/wizard-plugin-error';
const cli = createWizard({
name: 'my-cli',
description: 'My CLI application',
version: '1.0.0',
});
cli.use(createErrorPlugin()).parse();
API Reference
Parameters:Name | Type | Default |
---|---|---|
options | ErrorPluginOptions The options for the plugin. |
- ErrorPluginOptions
Name | Type | Default |
---|---|---|
exitProcess | boolean Whether to exit the process when an error occurs. | true |
Last updated on