# 终端终端

Canonical URL: https://developers.iagenify.com/zh/sdk/agent/bridges/terminals/
Language: zh

`terminals: { list, get, create, remove }`

壳壳比答案长——一个Dev服务器、一个监视器。提供它们和终端工具出现;计算机上显示它们来自机器本身。

Status: never on a phone · cloud needs it supplied · list is read, kill is exec

## 他们的原籍 {#where}

| 机 机 机 机 | 终端终端 |
| --- | --- |
| 电脑 | 透过 `storage.terminals` -除非你们供应 `files`,取代它们 |
| 电话 | **从来没有** 工具没有被声明, 无论您通过什么工具 |
| 一个云云工作空间 | 仅供给你们所供给的食物, |

> **提供一组是使用的**
>
> 传递终端会覆盖机器本身, 无论你在哪里。 程序可以将代理服务器放入用户能看到的服务器 。

## 形状 {#shape}

```javascript
const terminals = {
  async list()                       { /* → [terminal] */ },
  async get(id)                      { /* → terminal */ },
  async create({ name, cwd, command, port }) { /* → terminal */ },
  async remove(id)                   { /* → { ok: true } */ },
};

// A terminal
{
  id, name, cwd, busy, url,
  async run(line)                    { },
  async output({ since } = {})       { /* → the lines */ },
  async kill()                       { },
  async interrupt()                  { },
}
```

确实 [计算机自己的终端](/zh/sdk/ref/connected-storage/terminals)形状,所以代理工具无法显示 贝壳在运行。

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

| 操作 | 类别 |
| --- | --- |
| `list` · `output` | [读为](/zh/sdk/agent/permissions/categories/read) - 免费 |
| `kill` | [exec](/zh/sdk/agent/permissions/categories/exec) — asked |

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

## 特工被命令要怎么处置他们 {#servers}

- 启动服务器 `bash { background: true }`从来没有在前景。
- 从未分离 `nohup`, `&` 或一项工作——在用户无法阻止的地方隐藏着。
- 开始之前先列出可能已经运行的列表 。
- 通行证通行证通行证通行证通过 `port`,并让服务器在所有界面上监听,所以它报告的地址实际上是答案。
- 告诉用户 URL.

## 他们生活在一个掌握一揽子计划的进程之中 {#lifetime}

终端能生存一个答案,而不是重新开始。 携带软件包的软件拥有它们, 并且重新开始时也带着它们, 这在显示它们的界面中值得一提。

- [终端终端](/zh/sdk/agent/tools/terminal): 工具。
- [终端终端](/zh/sdk/ref/connected-storage/terminals): 电脑的

```python
class Terminals:
    def list(self): ...                               # → [terminal]
    def get(self, terminal_id): ...                   # → terminal
    def create(self, *, name="shell", cwd="", command=None, by="user"): ...   # → terminal
    def remove(self, terminal_id): ...                # → {"ok": True}

# A terminal: id, name, status, busy, run(line), output(since=0), kill(), interrupt()

agent = api.agents.create(runtime="local", machine=pc, model=model, terminals=Terminals())
```
