nemo_gym.cli.main
nemo_gym.cli.main
Module Contents
Classes
Functions
Data
API
Bases: ArgumentParser
ArgumentParser that appends a difflib “did you mean?” hint to invalid-choice errors.
Covers mistyped commands/groups and bad —flag choices (e.g. —storage), since argparse validates all of them as choices against the registry baked into the parser.
Map a named asset (name or name/flavor) to its config path.
Searches the roots from :func:~nemo_gym.discovery.component_search_roots (NEMO_GYM_EXTRA_ROOTS +
cwd + install root), the same helper that backs gym list/gym search, so config resolution and
discovery agree on where components live. On a name collision across roots the highest-priority root wins
(as in gym list), with a warning. --search-dir reaches here via NEMO_GYM_EXTRA_ROOTS (set
in main). Searching the install root is what lets built-ins resolve by name from an arbitrary cwd
(e.g. a wheel install), not just inside the repo checkout.
A --<flag> NAME selector that resolves the named asset to a config and adds it to +config_paths.
A --name store_true flag that maps to the Hydra override +<hydra_key>=true when set.
Prepend --search-dir roots to NEMO_GYM_EXTRA_ROOTS for the duration of the command, then restore.
Setting the env var lets the roots reach every resolver (discovery, the —<component> selectors,
deep config/prompt/rollout resolution) and inherit into spawned server subprocesses.
The original value is restored (or the var unset) on exit so main() leaves no global side effect.
(sys.path is augmented with the new roots for plugin prepare.py imports and left as-is on exit.)
List the benchmark view of the unified workload catalog.
Coalesce all +config_paths=[...] tokens (from —config and asset selectors) into one (Hydra rejects dupes).
gym search [<type>] <query>: dispatch to the chosen type’s listing command (default environments),
which filters itself to the query config key already in overrides.
A --name VALUE flag that maps to the Hydra override +<hydra_key>=VALUE (omitted when unset).