Skip to content

Type Alias: CLIEntrypoint ​

CLIEntrypoint = (module, cliMap, handler, registerDestroy) => unknown

A CLI entrypoint in the style of lakutata 2.x: a function the entrypoint calls once when it starts (initialized: the objects it gets may inject the entrypoint), which reads the command line and runs its commands through the handler. A promise it returns is awaited, its rejection fails the entrypoint's startup (2.x did not await it). Prefer an adapter (commanderCLIEntrypoint of lakutata/adapter/commander) for new code.

Parameters ​

module ​

Module

The module owning the entrypoint (the application).

cliMap ​

CLIMap

The CLI actions' commands, each with the JSON schema of its input.

handler ​

CLIEntrypointHandler

Runs a command: dispatches a CLIContext to the matching action.

registerDestroy ​

EntrypointDestroyerRegistrar

Registers a function run when the entrypoint stops.

Returns ​

unknown

Released under the MIT License.