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 mode | Enable | Best for | Command |
|---|---|---|---|
| Sandbox shell | plugins.sandbox | Quick interactive shell access through Polyaxon | polyaxon sandbox shell |
| Sandbox exec | plugins.sandbox | One-off or scripted commands | polyaxon sandbox exec |
| tmux shell | plugins.tmux | Reconnectable terminal sessions | polyaxon ops shell |
| SSH | plugins.ssh | IDEs, native terminal tooling, tunnels, SFTP, SCP, and rsync when the image includes it | polyaxon ssh connect |
One-Off Commands
polyaxon sandbox exec -p quick-start -uid $RUN_UUID -- python -VUse 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_IDInteractive Shell
polyaxon sandbox shell -p quick-start -uid $RUN_UUIDUse 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: trueAttach with:
polyaxon ops shell -p quick-start -uid $RUN_UUIDAt a shell prompt, detach without ending the shell:
/opt/polyaxon/bin/tmux detach-clientThe 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.