Version Plugin
The Version Plugin provides version information for CLI applications built with Wizard.
Installation
npm install @hyperse/wizard-plugin-version
Quick Start
cli.ts
import { createWizard } from '@hyperse/wizard';
import { createVersionPlugin } from '@hyperse/wizard-plugin-version';
const cli = createWizard({
name: 'my-cli',
description: 'My CLI application',
version: '1.0.0',
});
cli.use(createVersionPlugin()).parse();
// execute command
// node ./cli.js --version
// print version information
// v1.0.0
API Reference
Parameters:Name | Type | Default |
---|---|---|
options | VersionPluginOptions |
Plugin<CommandNameToContext, MergeCommandNameToContext<CommandNameToContext, { version: object; }>, Flags>
- VersionPluginOptions
Name | Type | Default |
---|---|---|
flag | boolean Whether to register the global version flag. | true |
Last updated on