Skip to contents

Validates inputs, builds an argument vector, resolves runtime engine (native, docker, apptainer), executes via processx::run(), checks outputs, and returns a structured result.

Usage

ni_run(
  call,
  ...,
  dry_run = FALSE,
  echo = interactive(),
  provenance = TRUE,
  error_on_status = TRUE,
  return = c("result", "files")
)

Arguments

call

An ni_call object, or a spec ID (in which case remaining args are passed to ni_call()).

...

If call is a spec ID, passed to ni_call().

dry_run

Logical; if TRUE, print the resolved command and return without executing.

echo

Logical; if TRUE, print stdout/stderr in real time. Defaults to interactive().

provenance

Logical; write a provenance JSON sidecar. Default TRUE.

error_on_status

Logical; if TRUE (default), error when the command exits with a non-zero status. If FALSE, issue a warning instead.

return

One of "result" (default) or "files".

Value

An ni_result object, or (when return = "files") a character vector of output files with the full result attached as ni_result attribute.