Skip to main content

@svatah/yam-bindings-cli

The yam-bindings command line: bindings, heal, surface conform and the healing eval for module (a)

Exports

ExportKindSignature
appConfigfunctionexport function appConfig(root: string): Config["app"]config.app from a directory, or nothing.
BASE_URL_ENVvariableBASE_URL_ENV = "YAM_BASE_URL"YAM_BASE_URL, the environment half of the precedence.
bindingsCommandfunctionexport async function bindingsCommand(args: ParsedArgs, io: CommandIo): Promise<ExitCode>
boolOptionfunctionexport function boolOption(args: ParsedArgs, name: string, fallback = false): booleanA boolean option: present as a bare flag, or --name true|false.
CommandIointerfaceexport interface CommandIo
CONFIG_FILESvariableCONFIG_FILES = ["yam.config.yaml", "yam.config.yml", "yam.config.json"]
ConfigErrorclassexport class ConfigError extends ErrorA project config that will not load (LLD §3.5, §15).
ENDPOINT_ENVvariableENDPOINT_ENV = "YAM_ENDPOINT"Which endpoint is selected: YAM_ENDPOINT, else the config's default.
evalCommandfunctionexport async function evalCommand(args: ParsedArgs, io: CommandIo): Promise<ExitCode>
EXITvariableEXIT The exit codes of LLD §15.
ExitCodetypealiasexport type ExitCode = (typeof EXIT)[keyof typeof EXIT];
healCommandfunctionexport async function healCommand(args: ParsedArgs, io: CommandIo): Promise<ExitCode>
inputOptionsfunctionexport function inputOptions(--input k=v, repeated, beneath YAM_INPUT_<NAME> (LLD §10, §15).
loadConfigfunctionexport function loadConfig(root: string, env: NodeJS.ProcessEnv = process.env): { config: Config; file?: string }The config with the selected endpoint applied (Draft 2.22, REQ-CLI-11).
mainfunctionexport async function main(argv: readonly string[], io: CommandIo): Promise<ExitCode>
numberOptionfunctionexport function numberOption(args: ParsedArgs, name: string): number | undefinedA numeric option, or undefined when absent or unparseable.
parseArgsfunctionexport function parseArgs(argv: readonly string[]): ParsedArgs
ParsedArgsinterfaceexport interface ParsedArgsA small argument reader for the CLI (LLD §15).
registerAllAdaptersfunctionexport function registerAllAdapters(): void
resolveSessionTargetfunctionexport function resolveSessionTarget(The base URL and storage state a session should open with.
runBindingsCommandfunctionexport async function runBindingsCommand(The commands module (a) owns. Mounted by @svatah/yam under yam too.
sessionTargetfunctionexport function sessionTarget(resolveSessionTarget with the flag layer read off a command line.
SessionTargetinterfaceexport interface SessionTarget
SessionTargetSourcesinterfaceexport interface SessionTargetSources
STORAGE_STATE_ENVvariableSTORAGE_STATE_ENV = "YAM_STORAGE_STATE"YAM_STORAGE_STATE, the environment half of the precedence.
stringOptionfunctionexport function stringOption(args: ParsedArgs, name: string): string | undefinedA string option, or undefined when absent. A bare flag is not a string.
stringOptionsfunctionexport function stringOptions(args: ParsedArgs, name: string): string[]Every value of a repeated option, in order.
surfaceCommandfunctionexport async function surfaceCommand(args: ParsedArgs, io: CommandIo): Promise<ExitCode>