api.compute

terminals

api.compute.terminals.{ list, create, get, remove }

Manage the account's persistent isolated terminal sessions.

persistent until removedone Object Storage workspace
Using Python?

Switch any code block to Python: the choice applies to every page. Python SDK guide and resource reference.

MethodDescription
list(storageId?)List open terminals, optionally filtered to one Object Storage.
create(options)Open a terminal and optionally start its first command.
get(id)Read terminal state and output.
remove(id)Close the terminal and its container.
const terminal = await api.compute.terminals.create({
  storageId: "YOUR_OBJECT_STORAGE_ID",
  name: "build",
  command: "npm run dev",
  port: 3000,
});
console.log(terminal.id, terminal.url);
terminal = api.compute.terminals.create(
    storage_id="YOUR_OBJECT_STORAGE_ID",
    name="build",
    command="npm run dev",
    port=3000,
)
print(terminal.id, terminal.url)

The returned value is a ComputeTerminal. Use its methods to send input, poll output, open a preview, interrupt the current command or close the session.