Files
XCTerminal/README.md
2026-03-20 13:39:58 +08:00

73 lines
1.4 KiB
Markdown
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
# XCTerminal
基于 Electron 的无头终端应用,通过浏览器访问,支持 3x2 网格布局。
## 功能特性
- 网格布局终端面板3 列 x 2 行)
- 实时终端输出,支持 PowerShell
- 支持 WebSocket 和 HTTP 输入
- 自动选择空闲端口
- 跨平台Windows、macOS、Linux
## 快速开始
### 开发
```bash
npm install
npm run dev
```
### 构建
```bash
npm run electron:build
```
构建产物位于 `release/XCTerminal.exe`
### 使用
```bash
# 使用默认端口3002
./release/XCTerminal.exe
# 指定端口
./release/XCTerminal.exe --port=8080
# 或使用环境变量
PORT=8080 ./release/XCTerminal.exe
```
启动后访问 `http://localhost:3002`(或你指定的端口)。
## 项目结构
```
XCTerminal/
├── electron/ # Electron 主进程
│ ├── main.js # 入口文件
│ └── preload.js # 预加载脚本
├── src/ # React 前端
│ ├── App.tsx # 主组件
│ └── components/ # UI 组件
├── server/ # 独立服务器(可选)
│ └── index.js # 服务器入口
└── release/ # 构建产物
```
## 技术栈
- Electron无头模式
- React 19
- Vite
- Ghostty Web终端模拟
- node-ptyPTY 管理)
- ExpressHTTP 服务器)
- WebSocket实时 I/O
## 许可证
私有项目 - 保留所有权利。