Skip to content

CLI adapter

This adapter is a vendor-neutral runner for any installed CLI tool. The bin field names the executable. It is a bare name on PATH, and it is typically stamped from a catalog entry. The command field carries the space-separated subcommand path. You supply positional arguments and flag values through the node inspector. The DSL grammar accepts scalars only, so generated DSL emits bin and command and leaves values and positionals for the inspector form.

The adapter shells out argv-only (never through a shell):

<bin> <command path> <positionals...> <flags...>

The output is opportunistic. It is JSON when stdout parses as JSON, and otherwise it is { stdout, exitCode }. No vendor flags or credentials are injected. You express those as command values or through the tool’s own profile and auth. If bin is not on PATH, the node fails with a clear command-not-found error, and downstream fail edges can fire.

FieldTypeDescription
bin (required)stringExecutable to run - a bare name resolved on PATH
command (required)stringSubcommand path after the binary, space-separated
outputFilter (optional)stringRegex applied to the payload’s serialized form; the first capture group lands as payload.filtered
run[action: "Run tool"] {
adapter: "cli"
actionId: "cli-tool"
bin: "mytool"
command: "items list"
}

Catalog presets like Zowe Command (bin: "zowe") and GitHub Command (bin: "gh") are cli entries with the binary already stamped in. Each one also carries an embedded command catalog that the inspector’s picker reads. Each preset declares a minimum tool version, and the Node Hub verifies that version on the user’s machine.

list[action: "List open PRs"] {
adapter: "cli"
bin: "gh"
actionId: "cli-tool"
command: "pr list"
}