> This page is for Remediation Orchestrator.

> For clean Markdown of any page, append .md to the page URL.
> For a complete documentation index, see https://docs.nvidia.com/remediation-orchestrator/llms.txt.

# command

**Experimental.** For evaluation. Interfaces, configuration, and behavior may change incompatibly.

Runs remote shell commands and checks host reachability through SSH, including Teleport transport.

### Prerequisites

* Configured [SSH module](https://github.com/dsx-ai-factory/remediation-orchestrator/blob/1785e695a8bff76c910115b3c96398a5a59a7183/fern/pages/reference/starlark/catalog.mdx#ssh).
* Target hosts with the tools and permissions needed by your commands.

### Setup

* Add to tenant TOML:

```toml
[modules.command]
execution_method = "ssh"
default_timeout = "1m"
```

> **Note**
>
> This module must be enabled in your Remediation Orchestrator config before it is available to scripts.

This module provides utilities for executing remote commands.

## Members

* [execute](#execute)
* [wait_for_response](#wait_for_response)
* [wait_for_success](#wait_for_success)

## execute

Execute a system command and return its output.

Node ID to execute the command on. ID format is specific to the data center, and is presumed to be unique within that data center. Can be empty if hostname or ip is provided.

The command to execute.

The arguments to pass to the command as a list of strings.

Environment variables to set for the command as a dict of string keys and values.

Timeout duration as a string (e.g. '2m', '30s', '1h'). If not provided, the default timeout will be used.

Hostname to execute the command on. Used as fallback when node_id is empty.

IP address to execute the command on. Used as fallback when node_id is empty.

The result of the command execution.

## wait_for_response

Wait until a node becomes reachable by polling with a simple command.

Node ID to wait for. ID format is specific to the data center. Can be empty if hostname or ip is provided.

How long to wait between attempts as a string (e.g. '30s', '1m').

Maximum total time to wait as a string (e.g. '15m', '1h').

Hostname to wait for. Used as fallback when node_id is empty.

IP address to wait for. Used as fallback when node_id is empty.

The result indicating whether the node became reachable.

## wait_for_success

Wait until a bash command exits successfully.

Node ID to run the command on. ID format is specific to the data center. Can be empty if hostname or ip is provided.

The bash command to execute until it succeeds.

How long to wait between attempts as a string (e.g. '30s', '1m').

Maximum total time to wait as a string (e.g. '15m', '1h').

Hostname to run the command on. Used as fallback when node_id is empty.

IP address to run the command on. Used as fallback when node_id is empty.

The result indicating whether the command succeeded, including the successful command output.