Open a terminal in a container
Open an interactive shell inside a running container from Studio, the CLI or Python. This is a real terminal inside your container over a secure WebSocket, not SSH to the machine.
From Studio or the CLI#
Click Terminal on a running container, or run:
gft container shell <run-id>The CLI needs an interactive terminal. Press Ctrl+] to disconnect.
From Python#
import base64
with client.containers.shell(run_id, cols=100, rows=30) as terminal:
terminal.send_input("nvidia-smi\r")
while True:
frame = terminal.recv(timeout=30)
if frame["type"] == "output":
print(base64.b64decode(frame["data_base64"]).decode(errors="replace"), end="")
elif frame["type"] == "exit":
print("Shell exit code:", frame["code"])
breakThe session also supports resize.
Limits#
| Item | Limit |
|---|---|
| Sessions | 1 per run, 4 per organization |
| Session length | 10 minutes |
| Input and output | 1 MiB in, 2 MiB out |
Closing the terminal, stopping the run, expiry or revoked access ends the shell. Reconnecting starts a new session.
Access and privacy#
Each session checks your workspace, your identity and the run.write permission when you attach and while you work. GFT keeps no transcript or replay, and shell history and browser scrollback are off. Programs can still write files, and detached processes keep running until the container stops.
Runs started before terminal support show the terminal as unavailable. Start a new run to use it.