@gunshi/bone
v0.27.5
Published
gunshi minimum
Readme
@gunshi/bone
gunshi minimum
This package exports the bellow APIs and types.
cli: The main CLI function to run the command, not included@gunshi/plugin-globaland@gunshi/plugin-rendererbuilt-in plugins.- some basic type definitions only.
[!TIP] The APIs and type definitions available in this package are the same as those in the
gunshi/boneentry in thegunshipackage. This package is smaller in file size than thegunshipackage, making it suitable for use when you want to reduce the size of thenode_modulesin your cli application you are creating.
[!IMPORTANT] You cannot use the
clifunction in this entry to display the usage of the command with--helpoption. This entry point is provided to allow users to customize it completely, such as command usage rendering and plugin composition.
💿 Installation
# npm
npm install --save @gunshi/bone
## pnpm
pnpm add @gunshi/bone
## yarn
yarn add @gunshi/bone
## deno
deno add jsr:@gunshi/bone
## bun
bun add @gunshi/bone🚀 Usage
import { cli } from 'gunshi/bone'
import global from '@gunshi/plugin-global'
import renderer from '@gunshi/plugin-renderer'
import i18n from '@gunshi/plugin-i18n'
const entry = ctx => {
// entry logic ...
}
await cli(process.argv.slice(2), entry, {
// ...
plugins: [
global(),
renderer(),
i18n({
// plugin options ...
})
]
})