phoneide 1.0.0__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- phoneide-1.0.0.dist-info/METADATA +524 -0
- phoneide-1.0.0.dist-info/RECORD +25 -0
- phoneide-1.0.0.dist-info/WHEEL +5 -0
- phoneide-1.0.0.dist-info/entry_points.txt +3 -0
- phoneide-1.0.0.dist-info/licenses/LICENSE +199 -0
- phoneide-1.0.0.dist-info/licenses/NOTICE +15 -0
- phoneide-1.0.0.dist-info/top_level.txt +6 -0
- phoneide_server.py +911 -0
- routes/__init__.py +0 -0
- routes/ast_index.py +869 -0
- routes/browser.py +2746 -0
- routes/chat.py +16325 -0
- routes/debug.py +733 -0
- routes/files.py +4545 -0
- routes/git.py +1574 -0
- routes/notebook.py +630 -0
- routes/run.py +1058 -0
- routes/server_mgmt.py +272 -0
- routes/system_prompt.txt +603 -0
- routes/update.py +361 -0
- routes/venv.py +777 -0
- run_server.py +75 -0
- scripts/update_code.py +243 -0
- tray_manager.py +549 -0
- utils.py +1176 -0
|
@@ -0,0 +1,524 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: phoneide
|
|
3
|
+
Version: 1.0.0
|
|
4
|
+
Summary: 轻量级移动端 Web IDE,专为 Termux/Ubuntu 环境设计 - Lightweight Mobile Web IDE
|
|
5
|
+
Author-email: PhoneIDE Team <ctz168@users.noreply.github.com>
|
|
6
|
+
License: Apache-2.0
|
|
7
|
+
Project-URL: Homepage, https://github.com/ctz168/ide
|
|
8
|
+
Project-URL: Documentation, https://github.com/ctz168/ide#readme
|
|
9
|
+
Project-URL: Repository, https://github.com/ctz168/ide
|
|
10
|
+
Project-URL: Bug-Tracker, https://github.com/ctz168/ide/issues
|
|
11
|
+
Project-URL: Website, https://teambot.samai.cc
|
|
12
|
+
Keywords: ide,web-ide,code-editor,termux,mobile,flask,codemirror
|
|
13
|
+
Classifier: Development Status :: 4 - Beta
|
|
14
|
+
Classifier: Environment :: Web Environment
|
|
15
|
+
Classifier: Framework :: Flask
|
|
16
|
+
Classifier: Intended Audience :: Developers
|
|
17
|
+
Classifier: License :: OSI Approved :: Apache Software License
|
|
18
|
+
Classifier: Operating System :: OS Independent
|
|
19
|
+
Classifier: Programming Language :: Python :: 3
|
|
20
|
+
Classifier: Programming Language :: Python :: 3.8
|
|
21
|
+
Classifier: Programming Language :: Python :: 3.9
|
|
22
|
+
Classifier: Programming Language :: Python :: 3.10
|
|
23
|
+
Classifier: Programming Language :: Python :: 3.11
|
|
24
|
+
Classifier: Programming Language :: Python :: 3.12
|
|
25
|
+
Classifier: Topic :: Text Editors :: Integrated Development Environments (IDE)
|
|
26
|
+
Classifier: Topic :: Software Development :: Code Generators
|
|
27
|
+
Requires-Python: >=3.8
|
|
28
|
+
Description-Content-Type: text/markdown
|
|
29
|
+
License-File: LICENSE
|
|
30
|
+
License-File: NOTICE
|
|
31
|
+
Requires-Dist: flask>=3.0.0
|
|
32
|
+
Requires-Dist: flask-cors>=4.0.0
|
|
33
|
+
Requires-Dist: tree-sitter>=0.24.0
|
|
34
|
+
Requires-Dist: tree-sitter-python>=0.23.0
|
|
35
|
+
Requires-Dist: tree-sitter-javascript>=0.23.0
|
|
36
|
+
Requires-Dist: tree-sitter-typescript>=0.23.0
|
|
37
|
+
Requires-Dist: tree-sitter-go>=0.23.0
|
|
38
|
+
Requires-Dist: tree-sitter-rust>=0.23.0
|
|
39
|
+
Requires-Dist: tree-sitter-c>=0.23.0
|
|
40
|
+
Requires-Dist: python-docx>=1.0.0
|
|
41
|
+
Requires-Dist: python-pptx>=1.0.0
|
|
42
|
+
Requires-Dist: openpyxl>=3.1.0
|
|
43
|
+
Requires-Dist: PyPDF2>=3.0.0
|
|
44
|
+
Requires-Dist: reportlab>=4.0.0
|
|
45
|
+
Requires-Dist: edge-tts>=6.1.0
|
|
46
|
+
Requires-Dist: curl_cffi>=0.15.0
|
|
47
|
+
Provides-Extra: dev
|
|
48
|
+
Requires-Dist: pytest; extra == "dev"
|
|
49
|
+
Requires-Dist: flake8; extra == "dev"
|
|
50
|
+
Dynamic: license-file
|
|
51
|
+
|
|
52
|
+
<div align="center">
|
|
53
|
+
|
|
54
|
+
# PhoneIDE
|
|
55
|
+
|
|
56
|
+
**轻量级移动端 Web IDE,专为 Termux/Ubuntu 环境设计**
|
|
57
|
+
|
|
58
|
+
[](https://pypi.org/project/phoneide/)
|
|
59
|
+
[](https://pypi.org/project/phoneide/)
|
|
60
|
+
[](https://github.com/ctz168/ide/blob/main/LICENSE)
|
|
61
|
+
[](https://github.com/ctz168/ide)
|
|
62
|
+
|
|
63
|
+
[English](#english) | [中文文档](#中文文档)
|
|
64
|
+
|
|
65
|
+
</div>
|
|
66
|
+
|
|
67
|
+
---
|
|
68
|
+
|
|
69
|
+
## 中文文档
|
|
70
|
+
|
|
71
|
+
基于 Python Flask 后端 + CodeMirror 5 前端,提供完整的代码编辑、文件管理、Git 操作、代码运行、AI 编程助手等功能。
|
|
72
|
+
|
|
73
|
+
> 这是 [PhoneIDE](https://github.com/ctz168/phoneide) 的 **Web 服务组件**,可以独立运行,也可以被打包进 Android APK 中使用。
|
|
74
|
+
>
|
|
75
|
+
> 🌐 官网:[https://teambot.samai.cc](https://teambot.samai.cc)
|
|
76
|
+
|
|
77
|
+
## 快速开始
|
|
78
|
+
|
|
79
|
+
### pip 安装(推荐)
|
|
80
|
+
|
|
81
|
+
```bash
|
|
82
|
+
pip install phoneide
|
|
83
|
+
```
|
|
84
|
+
|
|
85
|
+
安装完成后,直接运行:
|
|
86
|
+
|
|
87
|
+
```bash
|
|
88
|
+
phoneide
|
|
89
|
+
```
|
|
90
|
+
|
|
91
|
+
或使用完整命令:
|
|
92
|
+
|
|
93
|
+
```bash
|
|
94
|
+
phoneide-server
|
|
95
|
+
```
|
|
96
|
+
|
|
97
|
+
服务启动后浏览器打开 `http://localhost:12345` 即可使用。
|
|
98
|
+
|
|
99
|
+
> **自定义端口**:`PHONEIDE_PORT=8080 phoneide`
|
|
100
|
+
|
|
101
|
+
### 一行命令安装
|
|
102
|
+
|
|
103
|
+
**全自动**:自动检测平台、安装 Python 依赖、克隆仓库、启动服务、检测端口、打开浏览器。一行命令,开箱即用:
|
|
104
|
+
|
|
105
|
+
**Windows(PowerShell):**
|
|
106
|
+
```powershell
|
|
107
|
+
irm https://raw.githubusercontent.com/ctz168/ide/main/install.ps1 | iex
|
|
108
|
+
```
|
|
109
|
+
|
|
110
|
+
**Linux / macOS / Termux:**
|
|
111
|
+
```bash
|
|
112
|
+
curl -fsSL https://raw.githubusercontent.com/ctz168/ide/main/install.sh | bash
|
|
113
|
+
```
|
|
114
|
+
|
|
115
|
+
安装完成后浏览器会自动打开,按 Ctrl+C 可停止服务。
|
|
116
|
+
|
|
117
|
+
> 支持平台:Windows 10/11、Termux、Ubuntu/Debian、Fedora、CentOS、macOS、Alpine、Arch、openSUSE
|
|
118
|
+
>
|
|
119
|
+
> 默认地址:`http://localhost:12345`
|
|
120
|
+
|
|
121
|
+
**自定义安装目录:**
|
|
122
|
+
```bash
|
|
123
|
+
# Linux / macOS
|
|
124
|
+
PHONEIDE_INSTALL_DIR=~/my-ide curl -fsSL https://raw.githubusercontent.com/ctz168/ide/main/install.sh | bash
|
|
125
|
+
# Windows
|
|
126
|
+
$env:PHONEIDE_INSTALL_DIR="C:\my-ide"; irm https://raw.githubusercontent.com/ctz168/ide/main/install.ps1 | iex
|
|
127
|
+
```
|
|
128
|
+
|
|
129
|
+
**自定义端口:**
|
|
130
|
+
```bash
|
|
131
|
+
# Linux / macOS
|
|
132
|
+
PHONEIDE_PORT=8080 curl -fsSL https://raw.githubusercontent.com/ctz168/ide/main/install.sh | bash
|
|
133
|
+
# Windows
|
|
134
|
+
$env:PHONEIDE_PORT="8080"; irm https://raw.githubusercontent.com/ctz168/ide/main/install.ps1 | iex
|
|
135
|
+
```
|
|
136
|
+
|
|
137
|
+
### 手动安装
|
|
138
|
+
|
|
139
|
+
**Windows:**
|
|
140
|
+
```powershell
|
|
141
|
+
# 1. 安装 Python 3.8+(去 https://www.python.org/downloads/ 下载,安装时勾选 Add to PATH)
|
|
142
|
+
# 2. 打开 PowerShell
|
|
143
|
+
pip install phoneide
|
|
144
|
+
phoneide
|
|
145
|
+
# 浏览器打开 http://localhost:12345
|
|
146
|
+
```
|
|
147
|
+
|
|
148
|
+
**Termux:**
|
|
149
|
+
```bash
|
|
150
|
+
pkg install python python-pip
|
|
151
|
+
pip install phoneide
|
|
152
|
+
phoneide
|
|
153
|
+
```
|
|
154
|
+
|
|
155
|
+
**Ubuntu / Debian / WSL:**
|
|
156
|
+
```bash
|
|
157
|
+
sudo apt install python3 python3-pip python3-venv
|
|
158
|
+
pip3 install --break-system-packages phoneide
|
|
159
|
+
phoneide
|
|
160
|
+
```
|
|
161
|
+
|
|
162
|
+
**macOS:**
|
|
163
|
+
```bash
|
|
164
|
+
brew install python
|
|
165
|
+
pip3 install phoneide
|
|
166
|
+
phoneide
|
|
167
|
+
```
|
|
168
|
+
|
|
169
|
+
**Fedora / CentOS:**
|
|
170
|
+
```bash
|
|
171
|
+
sudo dnf install python3 python3-pip
|
|
172
|
+
pip3 install phoneide
|
|
173
|
+
phoneide
|
|
174
|
+
```
|
|
175
|
+
|
|
176
|
+
**Alpine:**
|
|
177
|
+
```bash
|
|
178
|
+
sudo apk add python3 py3-pip
|
|
179
|
+
pip3 install --break-system-packages phoneide
|
|
180
|
+
phoneide
|
|
181
|
+
```
|
|
182
|
+
|
|
183
|
+
### Docker
|
|
184
|
+
|
|
185
|
+
```bash
|
|
186
|
+
docker run -d -p 1239:1239 -v ~/phoneide_workspace:/workspace python:3.12-slim bash -c \
|
|
187
|
+
"pip install phoneide && PHONEIDE_WORKSPACE=/workspace phoneide"
|
|
188
|
+
```
|
|
189
|
+
|
|
190
|
+
启动后浏览器打开 `http://localhost:12345` 即可使用。
|
|
191
|
+
|
|
192
|
+
## 功能特性
|
|
193
|
+
|
|
194
|
+
### 代码编辑器
|
|
195
|
+
|
|
196
|
+
基于 CodeMirror 5 内核,支持 30+ 种编程语言的语法高亮、自动补全、括号匹配、代码折叠、行号显示。支持 Python、JavaScript、TypeScript、Go、Rust、Java、C/C++、Shell、SQL 等主流语言。编辑器内置搜索替换(正则表达式),可快速定位和批量修改代码。
|
|
197
|
+
|
|
198
|
+
### 文件管理
|
|
199
|
+
|
|
200
|
+
完整的文件树浏览体验,支持打开任意文件夹作为工作空间。可以新建文件和目录、重命名、删除。文件列表自动识别文件类型并显示对应图标。
|
|
201
|
+
|
|
202
|
+
### Git 集成
|
|
203
|
+
|
|
204
|
+
内置全套 Git 操作界面:查看状态(status)、提交日志(log)、分支切换(checkout)、暂存区管理(add)、提交(commit)、远程推送(push)、拉取(pull)、仓库克隆(clone)、Diff 查看、Stash 暂存。
|
|
205
|
+
|
|
206
|
+
### 代码运行
|
|
207
|
+
|
|
208
|
+
支持直接在 IDE 中运行代码。自动检测系统中已安装的编译器和运行时(Python、Node.js、GCC、G++、Go、Rust、Ruby、Lua、Bash 等)。运行输出通过 SSE 实时流式推送,运行中随时可以终止进程。
|
|
209
|
+
|
|
210
|
+
### 虚拟环境
|
|
211
|
+
|
|
212
|
+
内置 Python 虚拟环境管理,可以一键创建、切换 venv。激活后运行代码自动使用 venv 中的 Python 和已安装的包。
|
|
213
|
+
|
|
214
|
+
### AI 编程助手
|
|
215
|
+
|
|
216
|
+
右侧滑出面板集成 LLM 对话功能,支持配置任意 OpenAI 兼容 API(自定义 API 地址)。AI 内置 Agent 工具能力:读写文件、执行命令、全局搜索、Git 操作等。对话历史自动保存。
|
|
217
|
+
|
|
218
|
+
### 全局搜索
|
|
219
|
+
|
|
220
|
+
支持在整个项目范围内搜索文本,包括正则表达式、大小写敏感、文件类型过滤。搜索结果点击即可跳转到对应文件。支持跨文件批量替换。
|
|
221
|
+
|
|
222
|
+
### 移动端优化
|
|
223
|
+
|
|
224
|
+
专为手机触屏设计:从左侧边缘右滑打开文件侧边栏,从右侧边缘左滑打开 AI 对话面板。深色 Catppuccin 配色方案。
|
|
225
|
+
|
|
226
|
+
## 项目结构
|
|
227
|
+
|
|
228
|
+
```
|
|
229
|
+
ctz168/ide/
|
|
230
|
+
├── phoneide_server.py # Flask 入口,注册 7 个 Blueprint
|
|
231
|
+
├── utils.py # 共享工具函数、常量、配置管理
|
|
232
|
+
├── pyproject.toml # pip 包配置(PyPI 发布用)
|
|
233
|
+
├── requirements.txt # Python 依赖 (flask, flask-cors)
|
|
234
|
+
├── install.sh # Linux/macOS 全自动安装(安装+启动+打开浏览器)
|
|
235
|
+
├── install.ps1 # Windows PowerShell 全自动安装(安装+启动+打开浏览器)
|
|
236
|
+
├── start.sh # 启动脚本(处理端口占用)
|
|
237
|
+
├── routes/
|
|
238
|
+
│ ├── __init__.py
|
|
239
|
+
│ ├── files.py # 文件 CRUD:列表、读取、保存、创建、删除、重命名、搜索
|
|
240
|
+
│ ├── run.py # 代码执行:运行、停止、进程列表、SSE 输出流
|
|
241
|
+
│ ├── git.py # Git 操作:status/log/branch/checkout/add/commit/push/pull/clone/diff/stash
|
|
242
|
+
│ ├── chat.py # LLM 对话 + AI Agent:19 种工具,OpenAI 兼容协议
|
|
243
|
+
│ ├── venv.py # 虚拟环境:创建、激活、包列表、编译器检测
|
|
244
|
+
│ ├── server_mgmt.py # 服务管理:健康检查、配置、状态、重启、日志(SSE)
|
|
245
|
+
│ └── update.py # 更新检查:代码更新(ctz168/ide)、APK更新(ctz168/phoneide)
|
|
246
|
+
└── static/
|
|
247
|
+
├── index.html # 单页 IDE(工具栏 + 侧边栏 + 编辑器 + 底部面板 + AI面板)
|
|
248
|
+
├── css/
|
|
249
|
+
│ └── style.css # Catppuccin 深色主题 (~1560行),响应式布局
|
|
250
|
+
├── js/
|
|
251
|
+
│ ├── app.js # 主入口:手势控制、侧边栏切换、键盘快捷键
|
|
252
|
+
│ ├── editor.js # CodeMirror 5 编辑器管理
|
|
253
|
+
│ ├── files.js # 文件树浏览与管理
|
|
254
|
+
│ ├── git.js # Git 操作界面
|
|
255
|
+
│ ├── search.js # 全局搜索与替换
|
|
256
|
+
│ ├── terminal.js # 代码运行与输出
|
|
257
|
+
│ ├── chat.js # LLM 对话与 Agent 工具执行
|
|
258
|
+
│ └── debug.js # 调试面板:编译器选择、venv 管理
|
|
259
|
+
└── vendor/
|
|
260
|
+
├── codemirror/ # CodeMirror 5 核心 + 11 种语言模式 + 插件
|
|
261
|
+
└── marked/ # Markdown 渲染器
|
|
262
|
+
```
|
|
263
|
+
|
|
264
|
+
## API 接口
|
|
265
|
+
|
|
266
|
+
服务端运行在 `http://localhost:1239`,所有 API 均返回 JSON。
|
|
267
|
+
|
|
268
|
+
### 文件管理
|
|
269
|
+
|
|
270
|
+
| 方法 | 接口 | 说明 |
|
|
271
|
+
|------|------|------|
|
|
272
|
+
| GET | `/api/files/list?path=<dir>` | 列出目录文件 |
|
|
273
|
+
| GET | `/api/files/read?path=<file>` | 读取文件内容 |
|
|
274
|
+
| POST | `/api/files/save` | 保存文件 |
|
|
275
|
+
| POST | `/api/files/create` | 创建文件/目录 |
|
|
276
|
+
| POST | `/api/files/delete` | 删除文件/目录 |
|
|
277
|
+
| POST | `/api/files/rename` | 重命名文件/目录 |
|
|
278
|
+
| POST | `/api/files/open_folder` | 打开文件夹为工作空间 |
|
|
279
|
+
| POST | `/api/search` | 全局搜索 |
|
|
280
|
+
| POST | `/api/search/replace` | 全局替换 |
|
|
281
|
+
|
|
282
|
+
### 代码执行
|
|
283
|
+
|
|
284
|
+
| 方法 | 接口 | 说明 |
|
|
285
|
+
|------|------|------|
|
|
286
|
+
| POST | `/api/run/execute` | 执行代码 |
|
|
287
|
+
| POST | `/api/run/stop` | 终止运行 |
|
|
288
|
+
| GET | `/api/run/processes` | 列出运行中进程 |
|
|
289
|
+
| GET | `/api/run/output` | 获取进程输出 |
|
|
290
|
+
| GET | `/api/run/output/stream` | SSE 实时输出流 |
|
|
291
|
+
|
|
292
|
+
### Git 操作
|
|
293
|
+
|
|
294
|
+
| 方法 | 接口 | 说明 |
|
|
295
|
+
|------|------|------|
|
|
296
|
+
| GET | `/api/git/status` | Git 状态 |
|
|
297
|
+
| GET | `/api/git/log` | 提交日志 |
|
|
298
|
+
| GET | `/api/git/branch` | 分支列表 |
|
|
299
|
+
| GET | `/api/git/diff` | 查看 Diff |
|
|
300
|
+
| GET | `/api/git/remote` | 远程仓库信息 |
|
|
301
|
+
| POST | `/api/git/checkout` | 切换分支 |
|
|
302
|
+
| POST | `/api/git/add` | 暂存文件 |
|
|
303
|
+
| POST | `/api/git/commit` | 提交 |
|
|
304
|
+
| POST | `/api/git/push` | 推送 |
|
|
305
|
+
| POST | `/api/git/pull` | 拉取 |
|
|
306
|
+
| POST | `/api/git/clone` | 克隆仓库 |
|
|
307
|
+
| POST | `/api/git/stash` | Stash |
|
|
308
|
+
| POST | `/api/git/reset` | Reset |
|
|
309
|
+
|
|
310
|
+
### AI 对话
|
|
311
|
+
|
|
312
|
+
| 方法 | 接口 | 说明 |
|
|
313
|
+
|------|------|------|
|
|
314
|
+
| POST | `/api/chat/send` | 发送消息(非流式) |
|
|
315
|
+
| POST | `/api/chat/send/stream` | 发送消息(SSE 流式) |
|
|
316
|
+
| GET | `/api/chat/history` | 获取对话历史 |
|
|
317
|
+
| POST | `/api/chat/clear` | 清除对话历史 |
|
|
318
|
+
| GET | `/api/llm/config` | 获取 LLM 配置 |
|
|
319
|
+
| POST | `/api/llm/config` | 更新 LLM 配置 |
|
|
320
|
+
|
|
321
|
+
### 虚拟环境 & 编译器
|
|
322
|
+
|
|
323
|
+
| 方法 | 接口 | 说明 |
|
|
324
|
+
|------|------|------|
|
|
325
|
+
| GET | `/api/compilers` | 检测可用编译器 |
|
|
326
|
+
| POST | `/api/venv/create` | 创建虚拟环境 |
|
|
327
|
+
| POST | `/api/venv/activate` | 激活虚拟环境 |
|
|
328
|
+
| GET | `/api/venv/list` | 列出虚拟环境 |
|
|
329
|
+
| GET | `/api/venv/packages` | 查看已安装包 |
|
|
330
|
+
|
|
331
|
+
### 服务管理
|
|
332
|
+
|
|
333
|
+
| 方法 | 接口 | 说明 |
|
|
334
|
+
|------|------|------|
|
|
335
|
+
| GET | `/api/health` | 健康检查 |
|
|
336
|
+
| GET | `/api/config` | 获取配置 |
|
|
337
|
+
| POST | `/api/config` | 更新配置 |
|
|
338
|
+
| GET | `/api/server/status` | 服务器状态(端口、内存、进程数) |
|
|
339
|
+
| POST | `/api/server/restart` | 重启服务器 |
|
|
340
|
+
| POST | `/api/server/logs` | 获取日志 |
|
|
341
|
+
| GET | `/api/server/logs/stream` | SSE 实时日志流 |
|
|
342
|
+
| GET | `/api/system/info` | 系统信息 |
|
|
343
|
+
|
|
344
|
+
### 更新
|
|
345
|
+
|
|
346
|
+
| 方法 | 接口 | 说明 |
|
|
347
|
+
|------|------|------|
|
|
348
|
+
| POST | `/api/update/check` | 检查更新(APK + 代码) |
|
|
349
|
+
| POST | `/api/update/apply` | 应用代码更新 |
|
|
350
|
+
|
|
351
|
+
## 配置说明
|
|
352
|
+
|
|
353
|
+
IDE 配置存储在 `~/.phoneide/config.json`:
|
|
354
|
+
|
|
355
|
+
```json
|
|
356
|
+
{
|
|
357
|
+
"workspace": "~/phoneide_workspace",
|
|
358
|
+
"venv_path": "",
|
|
359
|
+
"compiler": "python3",
|
|
360
|
+
"theme": "dark",
|
|
361
|
+
"font_size": 14,
|
|
362
|
+
"tab_size": 4,
|
|
363
|
+
"show_line_numbers": true
|
|
364
|
+
}
|
|
365
|
+
```
|
|
366
|
+
|
|
367
|
+
LLM API 配置存储在 `~/.phoneide/llm_config.json`:
|
|
368
|
+
|
|
369
|
+
```json
|
|
370
|
+
{
|
|
371
|
+
"models": [
|
|
372
|
+
{
|
|
373
|
+
"name": "OpenAI",
|
|
374
|
+
"provider": "openai",
|
|
375
|
+
"api_type": "openai",
|
|
376
|
+
"api_key": "sk-xxx",
|
|
377
|
+
"api_base": "https://api.openai.com/v1",
|
|
378
|
+
"model": "gpt-4o-mini",
|
|
379
|
+
"enabled": true,
|
|
380
|
+
"temperature": 0.7,
|
|
381
|
+
"max_tokens": 50000,
|
|
382
|
+
"max_context": 128000,
|
|
383
|
+
"reasoning": true
|
|
384
|
+
}
|
|
385
|
+
],
|
|
386
|
+
"system_prompt": "You are a helpful coding assistant."
|
|
387
|
+
}
|
|
388
|
+
```
|
|
389
|
+
|
|
390
|
+
## 环境变量
|
|
391
|
+
|
|
392
|
+
| 变量 | 默认值 | 说明 |
|
|
393
|
+
|------|--------|------|
|
|
394
|
+
| `PHONEIDE_PORT` | `12345` | 服务监听端口 |
|
|
395
|
+
| `PHONEIDE_HOST` | `0.0.0.0` | 绑定地址 |
|
|
396
|
+
| `PHONEIDE_WORKSPACE` | `~/phoneide_workspace` | 默认工作空间路径 |
|
|
397
|
+
|
|
398
|
+
## 手势操作(移动端)
|
|
399
|
+
|
|
400
|
+
| 手势 | 功能 |
|
|
401
|
+
|------|------|
|
|
402
|
+
| 左侧边缘右滑 | 打开文件侧边栏 |
|
|
403
|
+
| 右侧边缘左滑 | 打开 AI 对话面板 |
|
|
404
|
+
| 在已打开的侧栏上左滑 | 关闭侧栏 |
|
|
405
|
+
| 长按文件 | 弹出上下文菜单(重命名、删除等) |
|
|
406
|
+
|
|
407
|
+
## 更新机制
|
|
408
|
+
|
|
409
|
+
**pip 更新(推荐):**
|
|
410
|
+
```bash
|
|
411
|
+
pip install --upgrade phoneide
|
|
412
|
+
```
|
|
413
|
+
|
|
414
|
+
**独立运行时(git clone):**
|
|
415
|
+
```bash
|
|
416
|
+
cd ide
|
|
417
|
+
git pull
|
|
418
|
+
# 重启 phoneide_server.py 即可
|
|
419
|
+
```
|
|
420
|
+
|
|
421
|
+
**在 PhoneIDE APK 内运行时:**
|
|
422
|
+
- 代码更新 → 自动从 `ctz168/ide` 拉取
|
|
423
|
+
- APK 更新 → 检查 `ctz168/phoneide` GitHub Releases
|
|
424
|
+
|
|
425
|
+
## 环境要求
|
|
426
|
+
|
|
427
|
+
| 项目 | 最低要求 |
|
|
428
|
+
|------|----------|
|
|
429
|
+
| Python | 3.8+ |
|
|
430
|
+
| 核心依赖 | flask >= 3.0.0, flask-cors >= 4.0.0 |
|
|
431
|
+
| Office/PDF 依赖 | python-docx >= 1.0.0, python-pptx >= 1.0.0, openpyxl >= 3.1.0, PyPDF2 >= 3.0.0, reportlab >= 4.0.0 |
|
|
432
|
+
| Git | 用于克隆仓库(安装脚本会自动安装) |
|
|
433
|
+
| 操作系统 | Windows 10/11, macOS, Linux (Termux/Ubuntu/Debian/Fedora/CentOS/Alpine/Arch) |
|
|
434
|
+
| 浏览器 | Chrome / Firefox / Safari / Edge(近两年版本) |
|
|
435
|
+
|
|
436
|
+
## 相关仓库
|
|
437
|
+
|
|
438
|
+
| 仓库 | 说明 |
|
|
439
|
+
|------|------|
|
|
440
|
+
| **ctz168/ide** (本仓库) | IDE 网页服务(Flask 后端 + 前端) |
|
|
441
|
+
| [ctz168/phoneide](https://github.com/ctz168/phoneide) | Android APK 封装(proot Ubuntu + WebView) |
|
|
442
|
+
|
|
443
|
+
## 技术栈
|
|
444
|
+
|
|
445
|
+
- **后端**: Python Flask + Flask-CORS
|
|
446
|
+
- **前端**: 原生 HTML/CSS/JavaScript(无框架)
|
|
447
|
+
- **编辑器**: CodeMirror 5(11 种语言模式 + 插件)
|
|
448
|
+
- **实时通信**: Server-Sent Events (SSE)
|
|
449
|
+
- **AI 集成**: OpenAI 兼容 API 协议
|
|
450
|
+
- **主题**: Catppuccin Mocha 深色配色
|
|
451
|
+
|
|
452
|
+
---
|
|
453
|
+
|
|
454
|
+
<a id="english"></a>
|
|
455
|
+
|
|
456
|
+
## English
|
|
457
|
+
|
|
458
|
+
A lightweight mobile Web IDE designed for Termux/Ubuntu environments.
|
|
459
|
+
|
|
460
|
+
Built with Python Flask backend + CodeMirror 5 frontend, providing complete code editing, file management, Git operations, code execution, AI coding assistant, and more.
|
|
461
|
+
|
|
462
|
+
> This is the **Web service component** of [PhoneIDE](https://github.com/ctz168/phoneide), which can run independently or be packaged into an Android APK.
|
|
463
|
+
>
|
|
464
|
+
> 🌐 Website: [https://teambot.samai.cc](https://teambot.samai.cc)
|
|
465
|
+
|
|
466
|
+
## Quick Start
|
|
467
|
+
|
|
468
|
+
### pip Install (Recommended)
|
|
469
|
+
|
|
470
|
+
```bash
|
|
471
|
+
pip install phoneide
|
|
472
|
+
```
|
|
473
|
+
|
|
474
|
+
After installation, simply run:
|
|
475
|
+
|
|
476
|
+
```bash
|
|
477
|
+
phoneide
|
|
478
|
+
```
|
|
479
|
+
|
|
480
|
+
Or use the full command:
|
|
481
|
+
|
|
482
|
+
```bash
|
|
483
|
+
phoneide-server
|
|
484
|
+
```
|
|
485
|
+
|
|
486
|
+
Once the server starts, open `http://localhost:12345` in your browser.
|
|
487
|
+
|
|
488
|
+
> **Custom port**: `PHONEIDE_PORT=8080 phoneide`
|
|
489
|
+
|
|
490
|
+
### One-Line Install
|
|
491
|
+
|
|
492
|
+
**Windows (PowerShell):**
|
|
493
|
+
```powershell
|
|
494
|
+
irm https://raw.githubusercontent.com/ctz168/ide/main/install.ps1 | iex
|
|
495
|
+
```
|
|
496
|
+
|
|
497
|
+
**Linux / macOS / Termux:**
|
|
498
|
+
```bash
|
|
499
|
+
curl -fsSL https://raw.githubusercontent.com/ctz168/ide/main/install.sh | bash
|
|
500
|
+
```
|
|
501
|
+
|
|
502
|
+
> Supported platforms: Windows 10/11, Termux, Ubuntu/Debian, Fedora, CentOS, macOS, Alpine, Arch, openSUSE
|
|
503
|
+
|
|
504
|
+
### Docker
|
|
505
|
+
|
|
506
|
+
```bash
|
|
507
|
+
docker run -d -p 1239:1239 -v ~/phoneide_workspace:/workspace python:3.12-slim bash -c \
|
|
508
|
+
"pip install phoneide && PHONEIDE_WORKSPACE=/workspace phoneide"
|
|
509
|
+
```
|
|
510
|
+
|
|
511
|
+
## Features
|
|
512
|
+
|
|
513
|
+
- **Code Editor**: CodeMirror 5 with 30+ language syntax highlighting, auto-completion, bracket matching, code folding
|
|
514
|
+
- **File Management**: Full file tree browsing, create/rename/delete files and directories
|
|
515
|
+
- **Git Integration**: Complete Git operations UI (status, log, branch, checkout, add, commit, push, pull, clone, diff, stash)
|
|
516
|
+
- **Code Execution**: Run code directly with auto-detected compilers and runtimes, real-time SSE output streaming
|
|
517
|
+
- **Virtual Environments**: Built-in Python venv management, one-click create and switch
|
|
518
|
+
- **AI Assistant**: LLM chat panel with OpenAI-compatible API, Agent tools for file operations and command execution
|
|
519
|
+
- **Global Search**: Project-wide text search with regex, case sensitivity, file type filtering, and batch replace
|
|
520
|
+
- **Mobile Optimized**: Touch-friendly gestures, Catppuccin dark theme
|
|
521
|
+
|
|
522
|
+
## License
|
|
523
|
+
|
|
524
|
+
Apache License 2.0
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
phoneide_server.py,sha256=8_FhJJZqRqyW5bmiahRRuI7wF-2xTRiZPYCvz1qImC4,36008
|
|
2
|
+
run_server.py,sha256=ooOX9vEO2sY-3qDQaGnep2UP-DLFfJ1fhyj5bDYXcMs,2613
|
|
3
|
+
tray_manager.py,sha256=fcsjcBrxTNLe4zfftK7pHi-eR8o4onFTrGeRJUSijhs,17139
|
|
4
|
+
utils.py,sha256=dAPBz9cC2KkcCA7TZ4xF4HRIHb1U2FT0gVjlIrqprgs,44125
|
|
5
|
+
phoneide-1.0.0.dist-info/licenses/LICENSE,sha256=F7-GmN2nKCfs95q4ezK-pUgtIHIYNI7FJEbMu64B_JE,11233
|
|
6
|
+
phoneide-1.0.0.dist-info/licenses/NOTICE,sha256=D948SLftKWyomUfZoI77MJ0sIduGiRK78H3kXM4dqPk,497
|
|
7
|
+
routes/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
8
|
+
routes/ast_index.py,sha256=7DZyk6xirGWfansRWa4xuCSDlJhHMlhXaNRPveMfhLM,37761
|
|
9
|
+
routes/browser.py,sha256=NG8UMuZ8EQZTJB9qLtu73RXXyMlbj8ZhbPY-B0aJmeg,131322
|
|
10
|
+
routes/chat.py,sha256=KQmCYQfLM9uWgfdgVc0di-L-Uh0aSlAS3QtPz--DwYQ,777421
|
|
11
|
+
routes/debug.py,sha256=auxTX_rJuPP8QC4WmZsa3UVhiJiBP9T8UvQJ1uiV7r0,27233
|
|
12
|
+
routes/files.py,sha256=2fftrQIFDBVIhZKUniYyEct2B2GVQRhDea0KEopfp1g,185165
|
|
13
|
+
routes/git.py,sha256=ZXleqtAljkcvHuCV1y4cVCJScIVHXeQ8CQZvmVVIDTU,57639
|
|
14
|
+
routes/notebook.py,sha256=gyUxltSKbx-yj7QUrrTW9tcvL_exlT2tLs8VeUyrLk0,21852
|
|
15
|
+
routes/run.py,sha256=hooRxNHuMlVDjwi3vRchk5EW8-x-olLGme9e5GQpX0U,40236
|
|
16
|
+
routes/server_mgmt.py,sha256=8nboUk-1xWSNwyXBnH0dUkCFKdbR-mB0oUslRQD-y0s,9377
|
|
17
|
+
routes/system_prompt.txt,sha256=lc521i-Zadbjh_bNqwWCQWHx4o-MU0ijh0iV2UqqZbk,42932
|
|
18
|
+
routes/update.py,sha256=hKjrCk7yXJjN-LMZ0F1Hdg2uSiBQFbbL8Xn16iFBXcw,12679
|
|
19
|
+
routes/venv.py,sha256=HeYy3RSIa23DnS8bCrX81mWHuoun_xAoVc4oc8EwUDU,32333
|
|
20
|
+
scripts/update_code.py,sha256=IxKLkx0Ffs4euveMnTfLFYQBgLgB2YeK1I8WPM_eDXA,8592
|
|
21
|
+
phoneide-1.0.0.dist-info/METADATA,sha256=QjeC7YDuxwMQY90a34kR_XGgLB_o4006v_uMIOsAp9U,17702
|
|
22
|
+
phoneide-1.0.0.dist-info/WHEEL,sha256=aeYiig01lYGDzBgS8HxWXOg3uV61G9ijOsup-k9o1sk,91
|
|
23
|
+
phoneide-1.0.0.dist-info/entry_points.txt,sha256=W1EGpU9L5XyhJVQLnKM3cFjdZemtc9yNWRNqKnlBA6U,84
|
|
24
|
+
phoneide-1.0.0.dist-info/top_level.txt,sha256=iaB23jGDV1F0SC_w4VuPkc_5GZWu5CVqye_wBlWcvM0,61
|
|
25
|
+
phoneide-1.0.0.dist-info/RECORD,,
|