# run()

Canonical URL: https://developers.iagenify.com/es/sdk/ref/compute-terminal/run/
Language: es

`terminal.run(line) → Promise<RunResult>`

Send one line of input to an idle terminal.

```javascript
const result = await terminal.run("npm test");
console.log(result.busy);
```

| Name | Type | Requirement | Description |
| --- | --- | --- | --- |
| `line` | string | required | 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()](/es/sdk/ref/compute-terminal/output) to collect the command's output and exit status.

```python
result = terminal.run("npm test")
print(result["busy"])
```
