| Method | Description |
|---|---|
| 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.