strictcli v0.39.0 /typescript/src/invoke
On this page

Programmatic invocation: app.call(commandPath, kwargs) runs a command in-process with pre-typed values, bypassing CLI parsing and env resolution.

#typescript/src/invoke

#typescript/src/invoke

Programmatic invocation: app.call(commandPath, kwargs) runs a command in-process with pre-typed values, bypassing CLI parsing and env resolution. It also skips config loading and stdin handling. Mirrors Go invoke.go with Python _invoke/call as the divergence ground truth where the two differ (group-path message, undefined-return value).

commandPath uses dot-separated segments ("deploy", "dns.zone.create"). kwargs keys use underscored parameter names ("dry_run", not "--dry-run"). Passthrough commands take the raw argument list under the special "_args" key. Failures throw InvokeError (errors.ts) instead of printing to stderr.

#CallOptions

TS typescript
export interface CallOptions

Per-call state that is NOT a handler kwarg. TS takes it as a trailing options object -- the idiomatic counterpart of Python's keyword-only argument and Go's variadic CallOption.

#commandClassification

TS typescript
export function commandClassification(cmd: RegisteredCommand):

Reads a registered command's effects-regime classification (schema.ts serializeCommand reads the same two carrier fields). Shared by the invoke consent check and the tool/MCP descriptors.

#invokeApp

TS typescript
export async function invokeApp(

The implementation behind App.call(). Resolves the command, populates a SourcedStore from kwargs (marked "cli" so mutex/dependency checks see them), runs the shared validation pipeline, and awaits the handler.

Search