@svatah/yam-bindings-cli
The yam-bindings command line: bindings, heal, surface conform and the healing eval for module (a)
- Source:
packages/bindings-cli· README:packages/bindings-cli/README.md - Install:
npm install @svatah/yam-bindings-cli· bin:yam-bindings - Version 0.1.0 · Apache-2.0
Exports
| Export | Kind | Signature | |
|---|---|---|---|
appConfig | function | export function appConfig(root: string): Config["app"] | config.app from a directory, or nothing. |
BASE_URL_ENV | variable | BASE_URL_ENV = "YAM_BASE_URL" | YAM_BASE_URL, the environment half of the precedence. |
bindingsCommand | function | export async function bindingsCommand(args: ParsedArgs, io: CommandIo): Promise<ExitCode> | |
boolOption | function | export function boolOption(args: ParsedArgs, name: string, fallback = false): boolean | A boolean option: present as a bare flag, or --name true|false. |
CommandIo | interface | export interface CommandIo | |
CONFIG_FILES | variable | CONFIG_FILES = ["yam.config.yaml", "yam.config.yml", "yam.config.json"] | |
ConfigError | class | export class ConfigError extends Error | A project config that will not load (LLD §3.5, §15). |
ENDPOINT_ENV | variable | ENDPOINT_ENV = "YAM_ENDPOINT" | Which endpoint is selected: YAM_ENDPOINT, else the config's default. |
evalCommand | function | export async function evalCommand(args: ParsedArgs, io: CommandIo): Promise<ExitCode> | |
EXIT | variable | EXIT | The exit codes of LLD §15. |
ExitCode | typealias | export type ExitCode = (typeof EXIT)[keyof typeof EXIT]; | |
healCommand | function | export async function healCommand(args: ParsedArgs, io: CommandIo): Promise<ExitCode> | |
inputOptions | function | export function inputOptions( | --input k=v, repeated, beneath YAM_INPUT_<NAME> (LLD §10, §15). |
loadConfig | function | export 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). |
main | function | export async function main(argv: readonly string[], io: CommandIo): Promise<ExitCode> | |
numberOption | function | export function numberOption(args: ParsedArgs, name: string): number | undefined | A numeric option, or undefined when absent or unparseable. |
parseArgs | function | export function parseArgs(argv: readonly string[]): ParsedArgs | |
ParsedArgs | interface | export interface ParsedArgs | A small argument reader for the CLI (LLD §15). |
registerAllAdapters | function | export function registerAllAdapters(): void | |
resolveSessionTarget | function | export function resolveSessionTarget( | The base URL and storage state a session should open with. |
runBindingsCommand | function | export async function runBindingsCommand( | The commands module (a) owns. Mounted by @svatah/yam under yam too. |
sessionTarget | function | export function sessionTarget( | resolveSessionTarget with the flag layer read off a command line. |
SessionTarget | interface | export interface SessionTarget | |
SessionTargetSources | interface | export interface SessionTargetSources | |
STORAGE_STATE_ENV | variable | STORAGE_STATE_ENV = "YAM_STORAGE_STATE" | YAM_STORAGE_STATE, the environment half of the precedence. |
stringOption | function | export function stringOption(args: ParsedArgs, name: string): string | undefined | A string option, or undefined when absent. A bare flag is not a string. |
stringOptions | function | export function stringOptions(args: ParsedArgs, name: string): string[] | Every value of a repeated option, in order. |
surfaceCommand | function | export async function surfaceCommand(args: ParsedArgs, io: CommandIo): Promise<ExitCode> |