Skip to content

gunshi / default

default

The main entry point for Gunshi.

Example

js
import { cli } from 'gunshi'

Variables

VariableDescription
DEFAULT_LOCALEThe default locale string, which format is BCP 47 language tag.

Functions

FunctionDescription
cliRun the command.
parseArgsParse command line arguments.
resolveArgsResolve command line arguments.

Classes

ClassDescription
DefaultTranslationTranslation adapter. This adapter is used to custom message formatter like Intlify message format, `Intl.MessageFormat` (MF2), and etc. This adapter will support localization with your preferred message format.

Interfaces

InterfaceDescription
ArgsAn object that contains argument schema.
ArgSchemaAn argument schema This schema is similar to the schema of the node:utils. difference is that: - multiple property is not supported - required property and description property are added - type is not only 'string' and 'boolean', but also 'number', 'enum' and 'positional' too. - default property type, not support multiple types
CommandCommand interface.
CommandContextCommand context. Command context is the context of the command execution.
CommandEnvironmentCommand environment.
CommandOptionsCommand options.
TranslationAdapterTranslation adapter. This adapter is used to custom message formatter like Intlify message format, `Intl.MessageFormat` (MF2), and etc. This adapter will support localization with your preferred message format.
TranslationAdapterFactoryOptionsTranslation adapter factory options.

References

define

Re-exports define


lazy

Re-exports lazy

Type Aliases

Type AliasDescription
ArgValuesAn object that contains the values of the arguments.
CommandableDefine a command type.
CommandArgKeysCommand i18n option keys. The command i18n option keys are used to translate function.
CommandBuiltinArgsKeysCommand i18n built-in arguments keys.
CommandBuiltinKeysCommand i18n built-in keys. The command i18n built-in keys are used to translate function.
CommandBuiltinResourceKeysCommand i18n built-in resource keys.
CommandLoader-
CommandResourceCommand resource.
CommandResourceFetcherCommand resource fetcher.
CommandRunnerCommand runner.
GenerateNamespacedKeyGenerate a namespaced key.
KeyOfArgs-
LazyCommandLazy command interface. Lazy command that's not loaded until it is executed.
RemovedIndexRemove index signature from object or record type.
TranslationAdapterFactoryTranslation adapter factory.

Released under the MIT License.