> 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.utils

## Module Contents

### Functions

| Name                                                                               | Description                                                                         |
| ---------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------- |
| [`exit_cleanly_on_config_error`](#nemo_gym-cli-utils-exit_cleanly_on_config_error) | Decorator: turn user-facing ConfigError into a clean message + non-zero exit.       |
| [`print_rich_table`](#nemo_gym-cli-utils-print_rich_table)                         | Print a Rich table without the 80-col truncation Rich applies when stdout is piped. |

### API

```python
nemo_gym.cli.utils.exit_cleanly_on_config_error(
    fn
)
```

Decorator: turn user-facing ConfigError into a clean message + non-zero exit.

Config mistakes (missing/typo'd config\_paths, malformed config\_paths, nothing configured to
run) should fail fast with an actionable message, not a Python traceback. Unexpected errors
still propagate normally.

```python
nemo_gym.cli.utils.print_rich_table(
    table
) -> None
```

Print a Rich table without the 80-col truncation Rich applies when stdout is piped.

On a TTY, Rich sizes the console to the terminal. When stdout is redirected (e.g.
`gym list benchmarks | cat`), Rich falls back to an 80-column console and truncates cells
with an ellipsis, silently losing data. We measure the table's natural width and render at
that width so piped output is lossless, while leaving interactive terminal output unchanged.