Skip to content

dstack attach

This command attaches to a given run. It establishes the SSH tunnel, forwards ports, and shows real-time run logs.

Usage

$ dstack attach --help
Usage: dstack attach [-h] [--project NAME] [--ssh-identity SSH_PRIVATE_KEY]
                     [--logs] [--host HOST] [-p MAPPING] [--replica REPLICA]
                     [--job JOB]
                     run_name

Positional Arguments:
  run_name

Options:
  -h, --help            Show this help message and exit
  --project NAME        The name of the project. Defaults to $DSTACK_PROJECT
  --ssh-identity SSH_PRIVATE_KEY
                        The private SSH key path for SSH tunneling
  --logs                Print run logs as they follow
  --host HOST           Local address to bind. Defaults to localhost.
  -p, --port MAPPING    Port mapping overrides
  --replica REPLICA     The replica number. Defaults to 0.
  --job JOB             The job number inside the replica. Defaults to 0.