# 界面

1. **桌面 App、Web UI、终端 TUI、CLI 单次调用**
2. **Worker，端口 18100** FastAPI 和 WebSocket 后端、Web UI、可选的聊天渠道适配器
3. **`~/.openprogram/projects/<project>/chats/`** 每个会话一个 git 仓库；没有项目的属于主项目 default

桌面 App 内嵌 Web UI，并增加原生的浏览器和终端面板。没有 worker 时，桌面 App 或 TUI 会启动一个。

## 选哪个

| 界面 | 打开方式 | 适合 |
| --- | --- | --- |
| [macOS 桌面](https://fzkuji.github.io/OpenProgram/docs/interfaces/desktop.zh.html) | `/Applications/OpenProgram.app` | 多面板聊天、Files、内置浏览器、终端、Agent 控制可见的内部网页 |
| [Web UI](https://fzkuji.github.io/OpenProgram/docs/interfaces/web.zh.html) | `openprogram web`，然后 `http://localhost:18100` | 聊天、DAG 分支视图、函数/技能/MCP/记忆管理、设置 |
| [终端 TUI](https://fzkuji.github.io/OpenProgram/docs/interfaces/tui.zh.html) | `openprogram tui`；只输入 `openprogram` 会先问终端还是网页 | 在终端聊天：斜杠命令、权限配置、可滚动历史 |
| [CLI 单次调用](https://fzkuji.github.io/OpenProgram/docs/interfaces/cli.zh.html) | `openprogram --print "..."` | 脚本、被其他程序调用、快速提问 |

## 换个界面继续会话

| 从 | 方式 |
| --- | --- |
| 终端到 Web | 在侧栏里，点击即可 |
| Web 到终端 | TUI 里 `/resume`，或 `openprogram --resume <session-id> --print "..."` |
| 单次调用 | 也会保存，任何界面都能打开 |

启动交互式 TUI 时 `--resume` 暂时不会选中会话，用 `/resume`。

## Worker

| 命令 | 效果 |
| --- | --- |
| `openprogram status`、`stop`、`restart` | 管理后台服务 |
| `openprogram worker install` | 登录时启动 |

## 隔离的工作区

`--profile <name>` 或 `OPENPROGRAM_PROFILE` 把状态从 `~/.openprogram/` 移到 `~/.openprogram-<name>/`：配置、会话、日志和凭证都分开，每个 profile 有自己的 worker。
