DocsUse Terminals
SandboxesUse Terminals
v1.16+

Use Terminals

Polyaxon supports several terminal workflows for service runs. Pick the smallest access mode that fits the task.

This page continues from the Sandbox Quick Start and uses its quick-start project and RUN_UUID variable. The component created there enables the sandbox, tmux, and SSH plugins.

Terminal Options

Access modeEnableBest forCommand
Sandbox shellplugins.sandboxQuick interactive shell access through Polyaxonpolyaxon sandbox shell
Sandbox execplugins.sandboxOne-off or scripted commandspolyaxon sandbox exec
tmux shellplugins.tmuxReconnectable terminal sessionspolyaxon ops shell
SSHplugins.sshIDEs, native terminal tooling, tunnels, SFTP, SCP, and rsync when the image includes itpolyaxon ssh connect

One-Off Commands

polyaxon sandbox exec -p quick-start -uid $RUN_UUID -- python -V

Use streaming for long-running commands:

polyaxon sandbox exec -p quick-start -uid $RUN_UUID --stream -- sh -lc 'pip list'

Detached Commands

Detached commands keep running after the CLI exits:

EXEC_ID=$(polyaxon sandbox exec -p quick-start -uid $RUN_UUID --detach -- sh -lc 'python train.py')

Read logs later:

polyaxon sandbox logs -p quick-start -uid $RUN_UUID $EXEC_ID

Interactive Shell

polyaxon sandbox shell -p quick-start -uid $RUN_UUID

Use this for quick inspection and short-lived debugging.

Reconnectable Shell

Enable plugins.tmux when you want a terminal session that survives browser, websocket, or local terminal disconnects:

plugins:
  tmux: true

Attach with:

polyaxon ops shell -p quick-start -uid $RUN_UUID

At a shell prompt, detach without ending the shell:

/opt/polyaxon/bin/tmux detach-client

The default keyboard shortcut is Ctrl+B, release both keys, then press lowercase d. On macOS, use Control (), not Command (). Do not type exit when you intend to detach: exiting the last tmux pane destroys the session, and the next polyaxon ops shell starts a new shell without its exported variables.