Skip to content

gunshi / definition

definition

The entry for gunshi command definition.

This entry point exports the following APIs and types:

  • define: A function to define a command.
  • lazy: A function to lazily load a command.
  • Some basic type definitions, such as Command, LazyCommand, etc.

Example

js
import { define } from 'gunshi/definition'

export default define({
  name: 'say',
  args: {
    say: {
      type: 'string',
      description: 'say something',
      default: 'hello!'
    }
  },
  run: ctx => {
    return `You said: ${ctx.values.say}`
  }
})

Functions

FunctionDescription
defineDefine a command
lazyDefine a lazy command with or without definition.

References

Args

Re-exports Args


ArgSchema

Re-exports ArgSchema


ArgValues

Re-exports ArgValues


Command

Re-exports Command


CommandLoader

Re-exports CommandLoader


CommandRunner

Re-exports CommandRunner


DefaultGunshiParams

Re-exports DefaultGunshiParams


ExtendContext

Re-exports ExtendContext


GunshiParams

Re-exports GunshiParams


LazyCommand

Re-exports LazyCommand

Released under the MIT License.