ComputeTerminal

run()

terminal.run(line) → Promise<RunResult>

Send one line of input to an idle terminal.

Using Python?

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

const result = await terminal.run("npm test");
console.log(result.busy);
result = terminal.run("npm test")
print(result["busy"])
linestringrequired

Line to send to the terminal. An occupied terminal rejects input rather than queuing it behind a running command.

The call updates the local busy state from the response. Poll output() to collect the command's output and exit status.