Get an API key
api.compute

terminals.create()

api.compute.terminals.create({ storageId, name?, command?, by?, port? }) → Promise<ComputeTerminal>

Create an isolated terminal. If <code>command</code> is supplied, it starts immediately and the terminal stays open after the command returns.

Using Python?

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

const terminal = await api.compute.terminals.create({
  storageId: "YOUR_OBJECT_STORAGE_ID",
  name: "shell",
  command: "npm run dev",
  by: "user",
  port: 3000,
});
terminal = api.compute.terminals.create(
    storage_id="YOUR_OBJECT_STORAGE_ID",
    name="shell",
    command="npm run dev",
    by="user",
    port=3000,
)
storageIdstringrequired

Object Storage mounted at /workspace.

namestring

Optional display name; defaults to shell.

commandstring|null

Optional first command to run.

bystring

Optional origin label recorded on the terminal; defaults to user.

portinteger|null

Optional port to expose for a preview. The terminal's url is null when no port is requested.

The returned object contains the terminal ID and current state. Keep the ID private to the account that created it.