> For clean Markdown of any page, append .md to the page URL.
> For a complete documentation index, see https://docs.nvidia.com/nemo/gym/llms.txt.
> For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://docs.nvidia.com/nemo/gym/_mcp/server.

# nemo_gym.cli

## Module Contents

### Classes

| Name                                           | Description                                                                                       |
| ---------------------------------------------- | ------------------------------------------------------------------------------------------------- |
| [`PipListConfig`](#nemo_gym-cli-PipListConfig) | -                                                                                                 |
| [`RunConfig`](#nemo_gym-cli-RunConfig)         | Start NeMo Gym servers for agents, models, and resources.                                         |
| [`RunHelper`](#nemo_gym-cli-RunHelper)         | -                                                                                                 |
| [`TestAllConfig`](#nemo_gym-cli-TestAllConfig) | Run tests for all server modules in the project.                                                  |
| [`TestConfig`](#nemo_gym-cli-TestConfig)       | Test a specific server module by running its pytest suite and optionally validating example data. |
| [`VersionConfig`](#nemo_gym-cli-VersionConfig) | Display gym version and system information.                                                       |

### Functions

| Name                                                             | Description                                                                    |
| ---------------------------------------------------------------- | ------------------------------------------------------------------------------ |
| [`_display_list_of_paths`](#nemo_gym-cli-_display_list_of_paths) | -                                                                              |
| [`_format_pct`](#nemo_gym-cli-_format_pct)                       | -                                                                              |
| [`_select_shard`](#nemo_gym-cli-_select_shard)                   | Deterministically select this shard's subset of modules.                       |
| [`_test_single`](#nemo_gym-cli-_test_single)                     | -                                                                              |
| [`_validate_data_single`](#nemo_gym-cli-_validate_data_single)   | -                                                                              |
| [`dev_test`](#nemo_gym-cli-dev_test)                             | Run core NeMo Gym tests with coverage reporting (runs pytest with --cov flag). |
| [`display_help`](#nemo_gym-cli-display_help)                     | Display a list of available NeMo Gym CLI commands.                             |
| [`dump_config`](#nemo_gym-cli-dump_config)                       | Display the resolved Hydra configuration for debugging purposes.               |
| [`e2e_rollout_collection`](#nemo_gym-cli-e2e_rollout_collection) | -                                                                              |
| [`init_resources_server`](#nemo_gym-cli-init_resources_server)   | Initialize a new resources server with template files and directory structure. |
| [`pip_list`](#nemo_gym-cli-pip_list)                             | List packages installed in a server's virtual environment.                     |
| [`reinstall`](#nemo_gym-cli-reinstall)                           | -                                                                              |
| [`run`](#nemo_gym-cli-run)                                       | Start NeMo Gym servers for agents, models, and resources.                      |
| [`status`](#nemo_gym-cli-status)                                 | -                                                                              |
| [`test`](#nemo_gym-cli-test)                                     | -                                                                              |
| [`test_all`](#nemo_gym-cli-test_all)                             | -                                                                              |
| [`version`](#nemo_gym-cli-version)                               | Display gym version and system information.                                    |

### Data

[`_FORCE_KILL_REAP_TIMEOUT_SEC`](#nemo_gym-cli-_FORCE_KILL_REAP_TIMEOUT_SEC)

[`_GRACEFUL_SHUTDOWN_TIMEOUT_SEC`](#nemo_gym-cli-_GRACEFUL_SHUTDOWN_TIMEOUT_SEC)

### API

```python
class nemo_gym.cli.PipListConfig()
```

**Bases:** [RunConfig](#nemo_gym-cli-RunConfig)

```python
class nemo_gym.cli.RunConfig()
```

**Bases:** [BaseNeMoGymCLIConfig](/nemo-gym/nemo_gym/config_types#nemo_gym-config_types-BaseNeMoGymCLIConfig)

Start NeMo Gym servers for agents, models, and resources.

Examples:

```python
config_paths="resources_servers/example_single_tool_call/configs/example_single_tool_call.yaml,\
responses_api_models/openai_model/configs/openai_model.yaml"
ng_run "+config_paths=[${config_paths}]"
```

```python
class nemo_gym.cli.RunHelper()
```

```python
nemo_gym.cli.RunHelper.check_http_server_statuses(
    successful_servers: typing.List[str]
) -> typing.List[typing.Tuple[str, nemo_gym.server_utils.ServerStatus]]
```

```python
nemo_gym.cli.RunHelper.display_server_instance_info() -> None
```

```python
nemo_gym.cli.RunHelper.poll() -> None
```

```python
nemo_gym.cli.RunHelper.run_forever() -> None
```

```python
nemo_gym.cli.RunHelper.shutdown() -> None
```

```python
nemo_gym.cli.RunHelper.start(
    global_config_dict_parser_config: nemo_gym.global_config.GlobalConfigDictParserConfig
) -> None
```

```python
nemo_gym.cli.RunHelper.wait_for_dry_run_spinup() -> None
```

```python
nemo_gym.cli.RunHelper.wait_for_spinup() -> None
```

```python
class nemo_gym.cli.TestAllConfig()
```

**Bases:** [BaseNeMoGymCLIConfig](/nemo-gym/nemo_gym/config_types#nemo_gym-config_types-BaseNeMoGymCLIConfig)

Run tests for all server modules in the project.

Examples:

```python
ng_test_all
```

```python
class nemo_gym.cli.TestConfig()
```

**Bases:** [RunConfig](#nemo_gym-cli-RunConfig)

Test a specific server module by running its pytest suite and optionally validating example data.

Examples:

```python
ng_test +entrypoint=resources_servers/example_single_tool_call
```

```python
nemo_gym.cli.TestConfig.model_post_init(
    context
)
```

```python
class nemo_gym.cli.VersionConfig()
```

**Bases:** [BaseNeMoGymCLIConfig](/nemo-gym/nemo_gym/config_types#nemo_gym-config_types-BaseNeMoGymCLIConfig)

Display gym version and system information.

Examples:

```python
# Display version information
ng_version

# Output as JSON
ng_version +json=true
```

```python
nemo_gym.cli._display_list_of_paths(
    paths: typing.List[pathlib.Path]
) -> str
```

```python
nemo_gym.cli._format_pct(
    count: int,
    total: int
) -> str
```

```python
nemo_gym.cli._select_shard(
    dir_paths: typing.List[pathlib.Path],
    shard_index: int,
    num_shards: int
) -> typing.List[pathlib.Path]
```

Deterministically select this shard's subset of modules.

Round-robin (stride) over a sorted list spreads heavy modules across shards more evenly than
contiguous chunks, which balances wall-time when the suite is parallelized across CI runners.

```python
nemo_gym.cli._test_single(
    test_config: nemo_gym.cli.TestConfig,
    global_config_dict: omegaconf.DictConfig
) -> subprocess.Popen
```

```python
nemo_gym.cli._validate_data_single(
    test_config: nemo_gym.cli.TestConfig
) -> None
```

```python
nemo_gym.cli.dev_test()
```

Run core NeMo Gym tests with coverage reporting (runs pytest with --cov flag).

Examples:

```python
ng_dev_test
```

```python
nemo_gym.cli.display_help()
```

Display a list of available NeMo Gym CLI commands.

Examples:

```python
ng_help
```

```python
nemo_gym.cli.dump_config()
```

Display the resolved Hydra configuration for debugging purposes.

Examples:

```python
ng_dump_config "+config_paths=[<config1>,<config2>]"
```

```python
nemo_gym.cli.e2e_rollout_collection()
```

```python
nemo_gym.cli.init_resources_server()
```

Initialize a new resources server with template files and directory structure.

Examples:

```python
ng_init_resources_server +entrypoint=resources_servers/my_server
```

```python
nemo_gym.cli.pip_list()
```

List packages installed in a server's virtual environment.

```python
nemo_gym.cli.reinstall()
```

```python
nemo_gym.cli.run(
    global_config_dict_parser_config: typing.Optional[nemo_gym.global_config.GlobalConfigDictParserConfig] = None
)
```

Start NeMo Gym servers for agents, models, and resources.

This command reads configuration from YAML files specified via `+config_paths` and starts all configured servers.
The configuration files should define server instances with their entrypoints and settings.

Examples:

```python
# Start servers with specific configs
config_paths="resources_servers/example_single_tool_call/configs/example_single_tool_call.yaml,\
responses_api_models/openai_model/configs/openai_model.yaml"
ng_run "+config_paths=[${config_paths}]"
```

```python
nemo_gym.cli.status()
```

```python
nemo_gym.cli.test()
```

```python
nemo_gym.cli.test_all()
```

```python
nemo_gym.cli.version()
```

Display gym version and system information.

```python
nemo_gym.cli._FORCE_KILL_REAP_TIMEOUT_SEC: int = 2
```

```python
nemo_gym.cli._GRACEFUL_SHUTDOWN_TIMEOUT_SEC: int = 1
```