nemo_gym.cli.utils
nemo_gym.cli.utils
Module Contents
Functions
API
A Did you mean \X`?fragment for the closest candidate tovalue, or ""` if none is close enough.
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.
Print an unknown <type> '<name>' error (with a did-you-mean hint) and exit nonzero.
Whether query fuzzily matches any of fields: a substring or a close difflib match (token-aware).
The shared matcher behind gym search <type> <query> across every component type.
Print the standard ‘nothing to show’ message for a gym list/gym search command.
component_type is the plural noun (benchmarks, environments, …). Keeps the message
and styling identical across every listing.
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.
Render the uniform gym list <type> <name> inspect view (or its --json payload).
details is an ordered label -> value mapping (e.g. {"config": ..., "agent": ...}). Text
sections (domain suffix, description, Details, Usage example) are omitted when empty.