Nexo Shell
The execution family: running commands and scripts on the sink host. See the overview for how every module executes and the shared parameter types.
What it does — runs a single shell command, dispatching on the host OS.
How it works
- The
commandparameter holds a full command line, split into arguments with shell-style quoting:echo 'a b'passesa bas one argument. No shell interpreter is involved — pipes and redirects are literal characters, never operators (scripted needs belong inShellScriptorPowershell). - Every parameter beyond
commandis appended as exactly one argument (STATIC verbatim, DATA from the event payload) — no quoting is applied to them, so a value containing quotes arrives literally. - On Linux, the first token resolves like any command line: from
PATH, or as an absolute path. IfSCRIPTS_FOLDERis set on the sink and the bare command name exists as a file in that folder, it resolves to that file. - On Windows, the command line runs via
cmd.exe /c. Because cmd re-parses the command string, a DATA parameter containing cmd metacharacters (& | ^ < > %, CR, LF) is rejected loudly — STATIC content is flow-author intent and allowed; use the Powershell modules for complex Windows commands.
Needs from the node — nothing declared; any sink node matches. Windows hosts use cmd.exe (present by default).
Parameters
| Key | Type options | Meaning |
|---|---|---|
command | STATIC (usual) or DATA | The full command line — the first parameter |
| (additional) | STATIC or DATA | Appended as one argument each, in order |
ShellScript
Section titled “ShellScript”What it does — executes a shell script that lives on the sink host, and nothing else.
How it works
- The first parameter must be a bare script filename — no
/,\, or..— that exists as a file in the sink host’sSCRIPTS_FOLDER. There is noPATHfallback:echo,sh, and friends are refused. - The remaining parameters are passed to the script as arguments (unquoted, as subprocess arguments) — positionally, or as
--key valuepairs when the reservedarg_styleparam isnamed(below). - The script runs with ParseOutput and emits result markers itself.
Argument style — the reserved STATIC param arg_style switches the argument shape:
positional(default, or absent): every value appends verbatim, in param order.named: the script name stays the first token; every other param renders as--<key> <value>. A STATIC value that already starts with-passes verbatim (pre-formed flags), and a DATA param with an empty payload value is skipped (no dangling--<key>).- The
arg_styleparam itself never lands in the script’s arguments.
Needs from the node — SCRIPTS_FOLDER must be set on the sink service (systemd installer flag or environment variable); nothing is declared in the library’s requirements, so placement matches any sink node — a sink without the folder fails the event instead.
Parameters
| Key | Type options | Meaning |
|---|---|---|
script | STATIC or DATA | The bare script filename in SCRIPTS_FOLDER — the first parameter |
| (additional) | STATIC or DATA | Passed to the script as arguments — positional, or --key value in named style |
arg_style | STATIC — positional (default) or named | Reserved: selects the argument shape; never passed to the script |
Powershell
Section titled “Powershell”What it does — free-form PowerShell execution via pwsh -Command.
How it works
- The first parameter is the command string, executed with
pwsh -Command. - Every further parameter becomes a
$varassignment prepended to the command, so the command can reference it:STATIC→ assigned as a single-quoted PowerShell literal (''doubling, no interpolation).DATA→ assigned base64-decoded, so the value survives every PowerShell quoting rule and arrives verbatim — hostile payloads can’t break out of the assignment.
- The command itself may be
STATICorDATA— it is the module’s designated code-execution channel.
Needs from the node — the pwsh engine, minimum version 5.1.
Parameters
| Key | Type options | Meaning |
|---|---|---|
command | STATIC or DATA | The PowerShell command string — the first parameter |
| (additional) | STATIC or DATA | Exposed to the command as $var assignments, in order |
PowershellScript
Section titled “PowershellScript”What it does — executes a .ps1 script that lives on the sink host, and nothing else.
How it works
- The first parameter must be a bare
.ps1filename (no/,\,..) that exists inSCRIPTS_FOLDER(mandatory — noPATHfallback). - Every further parameter is exposed twice: as a
$varassignment prepended to the invocation (STATICliteral /DATAbase64-decoded, same as Powershell) and as a named argument — the script is invoked as& '<script>' -key $key …. - The script runs with ParseOutput and emits result markers itself.
Needs from the node — the pwsh engine, minimum version 5.1, and SCRIPTS_FOLDER set on the sink.
Parameters
| Key | Type options | Meaning |
|---|---|---|
script | STATIC or DATA | The bare .ps1 filename in SCRIPTS_FOLDER — the first parameter |
| (additional) | STATIC or DATA | Exposed as $var and passed as -key $key named arguments |
CmdScript
Section titled “CmdScript”What it does — executes a Windows batch script (.bat / .cmd) that lives on the sink host, and nothing else.
How it works
- The first parameter must be a bare
.bat/.cmdfilename (no/,\,..) that exists inSCRIPTS_FOLDER(mandatory — noPATHfallback; the extension is enforced). - Further parameters are delivered positionally — the script receives them as
%1 %2 …. Runtime argument quoting applies, and substitution happens after cmd has parsed the line, so payload characters are not re-parsed by cmd. - The script runs with ParseOutput and emits result markers itself.
Needs from the node — Windows only (declared os_families: win — a Linux node never matches), and SCRIPTS_FOLDER set on the sink.
Parameters
| Key | Type options | Meaning |
|---|---|---|
script | STATIC or DATA | The bare .bat/.cmd filename in SCRIPTS_FOLDER — the first parameter |
| (additional) | STATIC or DATA | Positional arguments — the script reads them as %1 %2 … |