> ## Documentation Index
> Fetch the complete documentation index at: https://docs.flex.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# training debug-ssh

> Start an interactive SSH session into a training job's runtime

Starts an Interactive Training Job that allows connecting through SSH or VSCode to the Training Runtime, useful for fast test iterations.

The `--vscode` flag is optional, but highly recommended to leverage the full potential of the Interactive Training Runtime.

## Usage

```bash theme={null}
flexai training debug-ssh \
  --repository-url <repository_url> \
  [--dataset <dataset_name>...] \
  [--repository-revision <branch_name>] \
  [--checkpoint <checkpoint_id>] \
  [--env <env_var>=<value>...] \
  [--secret <env_var>=<secret_value>...] \
  [--nodes <node_count>] \
  [--accels <accelerator_count>] \
  [--device-arch <device_architecture>] \
  [--git-author-name <git_author_name>] \
  [--git-author-email <git_author_email>] \
  [--dotfiles <dotfiles_repository>] \
  [--authorized-keys <ssh_public_key>] \
  [--session-timeout <timeout_in_seconds>] \
  [--vscode]
```

## Flags

| Flag                    | Short | Type      | Default        | Description                                                                                                                                                                                                                                                                                                                                                                                                            |
| ----------------------- | ----- | --------- | -------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `--accels`              | `-a`  | integer   | `1`            | Number of accelerators/GPUs to use.                                                                                                                                                                                                                                                                                                                                                                                    |
| `--affinity`            |       | key=value |                | Pins the workload to a specific cluster. Format: `cluster=<cluster_name>`. Use [`flexai cluster list`](/cli/reference/cluster/list) to see clusters available to your organization. Useful when you need a specific accelerator type (for example, NVIDIA H100 vs A100). The only recognized key today is `cluster`. When set, this takes precedence over the cluster FlexAI would have selected from `--device-arch`. |
| `--authorized-keys`     |       | string    | ssh-agent keys | List of SSH public keys to allow connecting to the interactive environment. If not provided, keys will be gathered from the local ssh-agent, if available.                                                                                                                                                                                                                                                             |
| `--build-secret`        |       | key=value |                | FlexAI Secrets to make available during the image build process. Format: `<flexai_secret_name>=<environment_variable_name>`                                                                                                                                                                                                                                                                                            |
| `--checkpoint`          | `-C`  | string    |                | A Checkpoint to mount on the runtime environment. Can be a name or UUID.                                                                                                                                                                                                                                                                                                                                               |
| `--dataset`             | `-D`  | string    |                | Dataset to mount on the runtime environment. Can be repeated for multiple datasets. Optionally specify mount path with `name=path` format.                                                                                                                                                                                                                                                                             |
| `--device-arch`         | `-d`  | string    | `nvidia`       | The architecture of the device to run on.                                                                                                                                                                                                                                                                                                                                                                              |
| `--dotfiles`            |       | string    |                | GitHub dotfiles repository URL that will be installed in the home directory of the interactive environment.                                                                                                                                                                                                                                                                                                            |
| `--env`                 | `-E`  | key=value |                | Environment variables to set in the interactive environment. Can be repeated.                                                                                                                                                                                                                                                                                                                                          |
| `--git-author-email`    |       | string    | git config     | The Git commit author email to use in the interactive training environment.                                                                                                                                                                                                                                                                                                                                            |
| `--git-author-name`     |       | string    | git config     | The Git commit author name to use in the interactive training environment.                                                                                                                                                                                                                                                                                                                                             |
| `--help`                | `-h`  | boolean   |                | Displays this help page.                                                                                                                                                                                                                                                                                                                                                                                               |
| `--no-queuing`          |       | boolean   |                | Disables queuing for this workload: If no resources are available, the workload will fail immediately.                                                                                                                                                                                                                                                                                                                 |
| `--nodes`               | `-n`  | integer   | `1`            | The number of nodes across which to distribute the workload. Selecting more than 1 node will set 8 accelerators per node.                                                                                                                                                                                                                                                                                              |
| `--repository-revision` | `-b`  | string    | `main`         | The branch name, commit SHA, or tag of the repository to use.                                                                                                                                                                                                                                                                                                                                                          |
| `--repository-url`      | `-u`  | string    |                | Git repository URL containing code to mount on the workload environment. Will be mounted on `/workspace`.                                                                                                                                                                                                                                                                                                              |
| `--requirements-path`   | `-q`  | string    |                | Path to a pip requirements.txt file in the repository.                                                                                                                                                                                                                                                                                                                                                                 |
| `--runtime`             | `-r`  | string    |                | Name of the runtime to use.                                                                                                                                                                                                                                                                                                                                                                                            |
| `--secret`              | `-S`  | key=value |                | Environment variables set from FlexAI Secrets. Format: `<env_var_name>=<flexai_secret_name>`. Can be repeated.                                                                                                                                                                                                                                                                                                         |
| `--session-timeout`     |       | integer   | `600`          | Timeout in seconds after which the interactive session will be stopped if no activity is detected.                                                                                                                                                                                                                                                                                                                     |
| `--verbose`             | `-v`  | boolean   |                | Provides more detailed output when running a debug-ssh session.                                                                                                                                                                                                                                                                                                                                                        |
| `--vscode`              |       | boolean   |                | Opens Visual Studio Code connected to the runtime environment via SSH.                                                                                                                                                                                                                                                                                                                                                 |
