Skip to Content
🎉 Hyperse Wizard has been published.

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:
NameTypeDefault
optionsErrorPluginOptions

The options for the plugin.

Returns:
Plugin<CommandNameToContext, CommandNameToContext, Flags>
  • ErrorPluginOptions
NameTypeDefault
exitProcessboolean

Whether to exit the process when an error occurs.

true
Last updated on