Gå til hovedinnhold

External Command tool

The External Command tool pipes each block's text through an external command-line program and captures the program's standard output as the new text. It lets a pipeline reuse an existing CLI filter — a custom normalizer, a spell-fixer, a transliterator — without writing a native tool.

Text can be sent to the command on standard input or substituted into the argument list via the ${source} and ${target} placeholders. A command is required, and a target locale is required when applying to the target. Each invocation has a timeout; the exit code is recorded on the block, and a non-zero exit leaves the text unchanged and records the error.

IDexternal-command
SourceBuilt-in
Categorytext-processing
Cardinalitymonolingual
Tagsconfigurable

Parameters

ParameterTypeDefaultDescription
applySourcebooleanfalseProcess source text
applyTargetbooleantrueProcess target text
argsstring[]Command arguments; use ${source} and ${target} as placeholders
commandstringThe command to execute
sendAsStdinbooleantrueSend text via stdin instead of command arguments
targetLocalestringTarget locale for processing
timeoutinteger30Timeout in seconds

Configure these parameters interactively and copy the flow-step YAML on the Tool Reference.

Examples

Pipe target text through a formatter

Run an external program on the target, sending text on stdin.

command: my-formatter
applyTarget: true
targetLocale: fr-FR

Pass text as an argument

Substitute the text into the argument list instead of stdin.

command: transform
args: ["--text", "${source}"]
applySource: true
sendAsStdin: false

Processing notes

  • Operates on translatable blocks only; non-translatable blocks pass through unchanged.

  • Trailing newlines are trimmed from the captured output.

Limitations

  • A non-zero exit code leaves the text unchanged and records the exit code and error message as block properties.

  • The command runs once per block per scope (source and/or target), which can be slow for large documents.

← Back to the Tool Reference