# 多实例与 Profile

| 项目 | 默认 | Profile `dev` |
| --- | --- | --- |
| 状态：配置、会话、日志、记忆 | `~/.openprogram/` | `~/.openprogram-dev/` 任意名称：`~/.openprogram-<name>/` |
| 端口：API、WebSocket 和 Web UI | `18100` `http://localhost:18100` | `openprogram --profile dev ports --port 18200` `http://localhost:18200` |
| 启动 | `openprogram web` | `openprogram --profile dev web` |
| 查看 | `openprogram status` | `openprogram --profile dev status` |
| 登录服务 | `openprogram worker install` | `openprogram --profile dev worker install` |

实例之间不共享数据。每个 profile 有自己的登录服务，`worker start`、`stop`、`restart`、`status`、`uninstall` 只作用于当前 profile，停止或升级 `dev` 不影响默认 worker。

**选择 profile 或端口的其他方式**

| 方式 | 示例 |
| --- | --- |
| 全局参数，放在子命令前；优先于环境变量 | `openprogram --profile dev sessions list` `openprogram --profile dev worker restart` |
| 用环境变量选 profile | `OPENPROGRAM_PROFILE=dev openprogram` |
| 本次运行的端口 | `OPENPROGRAM_WEB_PORT=18200 openprogram web` |
| 仅这一次 `openprogram web` 的端口 | `openprogram web --web-port 18200` |
