# 终端终端

Canonical URL: https://developers.iagenify.com/zh/sdk/agent/tools/terminal/
Language: zh

`terminal({ action: "list" | "output" | "kill", id?, since? })`

运行的终端启动或用户打开。 阅读它们是免费的; 杀死一个是命令—— 类别取决于动作 。

Status: read, or exec on kill · survives the answer · never on a phone

| Name | Type | Requirement | Description |
| --- | --- | --- | --- |
| `action` | string | 必填 | `list` · `output` · `kill`. |
| `id` | string |  | 终点站 e.g. `t_3`需要 `output` 和 `kill`. |
| `since` | integer |  | `output`:从这一立场中读取。 `0` 保存的一切, 都归我所有。 |

## 一种工具中的两类 {#categories}

| 操作 | 类别 | 询问 |
| --- | --- | --- |
| `list` | 读为 | 从未 |
| `output` | 读为 | 从未 |
| `kill` | exec | 每种形体,只以足的、足的、 |

阅读服务器打印时不需要快速; 停止应该。 此类别是从参数中计算 。

## 工作循环 {#loop}

```javascript
terminal({ action: "list" })                       // is it already running?
bash({ command: "npm run dev", background: true, port: 5173 })
terminal({ action: "output", id: "t_3" })          // what did it print since last time?
terminal({ action: "kill", id: "t_3" })            // stop it and everything it started
```

> **开始之前的列表**
>
> 代理商被要求检查一个服务器,该服务器可能已经运行,而不是在同一端口启动第二个服务器,因为这个服务器的故障方式看起来似乎代码已经破解。

## 他们生活在你的生活过程中 {#lifetime}

终端可以生存一个答案,而不是重新启用软件包。 值得在列出它们的接口中说。

## 无 {#absent}

只有在应用程序提供时, 才会在云工作空间上 [终端终端](/zh/sdk/agent/bridges/terminals)电脑上,机器本身。

- [闪盘](/zh/sdk/agent/tools/bash): 开始一号
- [终端终端](/zh/sdk/agent/bridges/terminals): 提供你自己的
- [智能体工具](/zh/sdk/agent/tools): The 35, by family.

```python
# The calls the model makes, in order:
#   terminal {"action": "list"}                                  is it already running?
#   terminal {"action": "create", "command": "npm run dev"}      start it
#   terminal {"action": "output", "id": "t_3"}                   what did it print since last time?
#   terminal {"action": "kill", "id": "t_3"}                     stop it and everything it started
```
