> 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 full documentation content, see https://docs.nvidia.com/nemo/gym/llms-full.txt.

# nemo_gym.cli_setup_command

## Module Contents

### Functions

| Name                                                                                     | Description                                                            |
| ---------------------------------------------------------------------------------------- | ---------------------------------------------------------------------- |
| [`_get_nemo_gym_install_flags`](#nemo_gym-cli_setup_command-_get_nemo_gym_install_flags) | Build uv pip install flags for nemo-gym in sub-venvs.                  |
| [`_get_nemo_gym_version_spec`](#nemo_gym-cli_setup_command-_get_nemo_gym_version_spec)   | Detect nemo-gym version from parent venv and return version specifier. |
| [`run_command`](#nemo_gym-cli_setup_command-run_command)                                 | -                                                                      |
| [`setup_env_command`](#nemo_gym-cli_setup_command-setup_env_command)                     | -                                                                      |

### API

<Anchor id="nemo_gym-cli_setup_command-_get_nemo_gym_install_flags">
  <CodeBlock showLineNumbers={false} wordWrap={true}>
    ```python
    nemo_gym.cli_setup_command._get_nemo_gym_install_flags() -> str
    ```
  </CodeBlock>
</Anchor>

<Indent>
  Build uv pip install flags for nemo-gym in sub-venvs.

  Supports:

  * Pre-release versions via NEMO\_GYM\_ALLOW\_PRERELEASE=true
  * Custom PyPI indexes via UV\_INDEX\_URL, UV\_EXTRA\_INDEX\_URL, UV\_INDEX\_STRATEGY
  * Auto-detection of parent venv version for consistency

  **Returns:** `str`

  String of flags to add to 'uv pip install nemo-gym'
</Indent>

<Anchor id="nemo_gym-cli_setup_command-_get_nemo_gym_version_spec">
  <CodeBlock showLineNumbers={false} wordWrap={true}>
    ```python
    nemo_gym.cli_setup_command._get_nemo_gym_version_spec(
        is_editable_install: bool
    ) -> str
    ```
  </CodeBlock>
</Anchor>

<Indent>
  Detect nemo-gym version from parent venv and return version specifier.

  **Parameters:**

  <ParamField path="is_editable_install" type="bool">
    Whether nemo-gym is installed in editable mode in parent venv
  </ParamField>

  **Returns:** `str`

  Version specifier string (e.g., "==0.2.1rc0") or empty string
</Indent>

<Anchor id="nemo_gym-cli_setup_command-run_command">
  <CodeBlock showLineNumbers={false} wordWrap={true}>
    ```python
    nemo_gym.cli_setup_command.run_command(
        command: str,
        working_dir_path: pathlib.Path,
        server_name: str = ''
    ) -> subprocess.Popen
    ```
  </CodeBlock>
</Anchor>

<Indent />

<Anchor id="nemo_gym-cli_setup_command-setup_env_command">
  <CodeBlock showLineNumbers={false} wordWrap={true}>
    ```python
    nemo_gym.cli_setup_command.setup_env_command(
        dir_path: pathlib.Path,
        global_config_dict: omegaconf.DictConfig,
        prefix: str
    ) -> str
    ```
  </CodeBlock>
</Anchor>

<Indent />