xiaomi-xb 1.0.0__tar.gz

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.
Files changed (50) hide show
  1. xiaomi_xb-1.0.0/.gitignore +39 -0
  2. xiaomi_xb-1.0.0/.gitlab-ci.yml +39 -0
  3. xiaomi_xb-1.0.0/PKG-INFO +165 -0
  4. xiaomi_xb-1.0.0/README.md +137 -0
  5. xiaomi_xb-1.0.0/pyproject.toml +61 -0
  6. xiaomi_xb-1.0.0/xb/__init__.py +5 -0
  7. xiaomi_xb-1.0.0/xb/cli.py +55 -0
  8. xiaomi_xb-1.0.0/xb/commands/__init__.py +1 -0
  9. xiaomi_xb-1.0.0/xb/commands/build.py +62 -0
  10. xiaomi_xb-1.0.0/xb/commands/dev.py +51 -0
  11. xiaomi_xb-1.0.0/xb/commands/init.py +133 -0
  12. xiaomi_xb-1.0.0/xb/commands/version.py +63 -0
  13. xiaomi_xb-1.0.0/xb/templates/backend/api/__init__.py.j2 +3 -0
  14. xiaomi_xb-1.0.0/xb/templates/backend/api/config.py.j2 +253 -0
  15. xiaomi_xb-1.0.0/xb/templates/backend/backend_build.py.j2 +29 -0
  16. xiaomi_xb-1.0.0/xb/templates/backend/main.py.j2 +92 -0
  17. xiaomi_xb-1.0.0/xb/templates/backend/managers/__init__.py.j2 +7 -0
  18. xiaomi_xb-1.0.0/xb/templates/backend/managers/logger_manager.py.j2 +42 -0
  19. xiaomi_xb-1.0.0/xb/templates/backend/managers/path_manager.py.j2 +86 -0
  20. xiaomi_xb-1.0.0/xb/templates/backend/managers/sudoers_manager.py.j2 +141 -0
  21. xiaomi_xb-1.0.0/xb/templates/backend/requirements.txt.j2 +4 -0
  22. xiaomi_xb-1.0.0/xb/templates/configs/global_config.yaml.example.j2 +1 -0
  23. xiaomi_xb-1.0.0/xb/templates/configs/global_config.yaml.j2 +3 -0
  24. xiaomi_xb-1.0.0/xb/templates/electron/main.js.j2 +38 -0
  25. xiaomi_xb-1.0.0/xb/templates/electron/package.json.j2 +56 -0
  26. xiaomi_xb-1.0.0/xb/templates/frontend/index.html.j2 +12 -0
  27. xiaomi_xb-1.0.0/xb/templates/frontend/package.json.j2 +18 -0
  28. xiaomi_xb-1.0.0/xb/templates/frontend/src/App.vue.j2 +43 -0
  29. xiaomi_xb-1.0.0/xb/templates/frontend/src/components/ConfigSetup.vue.j2 +274 -0
  30. xiaomi_xb-1.0.0/xb/templates/frontend/src/components/FileManager.vue.j2 +429 -0
  31. xiaomi_xb-1.0.0/xb/templates/frontend/src/components/GitVersionBadge.vue.j2 +290 -0
  32. xiaomi_xb-1.0.0/xb/templates/frontend/src/components/HelloWorld.vue.j2 +5 -0
  33. xiaomi_xb-1.0.0/xb/templates/frontend/src/components/RefreshButton.vue.j2 +157 -0
  34. xiaomi_xb-1.0.0/xb/templates/frontend/src/main.js.j2 +5 -0
  35. xiaomi_xb-1.0.0/xb/templates/frontend/src/style.css.j2 +327 -0
  36. xiaomi_xb-1.0.0/xb/templates/frontend/vite.config.js.j2 +40 -0
  37. xiaomi_xb-1.0.0/xb/templates/root/.gitignore.j2 +33 -0
  38. xiaomi_xb-1.0.0/xb/templates/root/README.md.j2 +153 -0
  39. xiaomi_xb-1.0.0/xb/templates/root/build.sh.j2 +156 -0
  40. xiaomi_xb-1.0.0/xb/templates/root/dev.sh.j2 +142 -0
  41. xiaomi_xb-1.0.0/xb/templates/root/pyproject.toml.j2 +23 -0
  42. xiaomi_xb-1.0.0/xb/templates/scripts/example.sh.j2 +3 -0
  43. xiaomi_xb-1.0.0/xb/templates/version/hooks/pre-commit.j2 +72 -0
  44. xiaomi_xb-1.0.0/xb/templates/version/scripts/gui_version_manager.py.j2 +171 -0
  45. xiaomi_xb-1.0.0/xb/templates/version/scripts/install_hooks.sh.j2 +82 -0
  46. xiaomi_xb-1.0.0/xb/templates/version/scripts/version_manager.py.j2 +111 -0
  47. xiaomi_xb-1.0.0/xb/templates/version/scripts/web_version_manager.py.j2 +242 -0
  48. xiaomi_xb-1.0.0/xb/utils/__init__.py +1 -0
  49. xiaomi_xb-1.0.0/xb/utils/template_engine.py +221 -0
  50. xiaomi_xb-1.0.0/xb/utils/validators.py +8 -0
@@ -0,0 +1,39 @@
1
+ # Python
2
+ __pycache__/
3
+ *.pyc
4
+ *.pyo
5
+ *.pyd
6
+ .Python
7
+ *.so
8
+ *.egg
9
+ *.egg-info/
10
+ dist/
11
+ build/
12
+ .eggs/
13
+
14
+ # Virtual environments
15
+ .venv/
16
+ venv/
17
+ ENV/
18
+ env/
19
+
20
+ # uv
21
+ .uv/
22
+ uv.lock
23
+
24
+ # IDE
25
+ .vscode/
26
+ .idea/
27
+ *.swp
28
+ *.swo
29
+ .DS_Store
30
+
31
+ # Testing
32
+ .pytest_cache/
33
+ .coverage
34
+ htmlcov/
35
+
36
+ # Local dev
37
+ *.log
38
+ .env
39
+ .env.local
@@ -0,0 +1,39 @@
1
+ stages:
2
+ - package
3
+
4
+ variables:
5
+ PYTHON_IMAGE: "micr.cloud.mioffice.cn/dockerhub/library/python:3.10-slim"
6
+
7
+ cache:
8
+ key: ${CI_COMMIT_REF_SLUG}
9
+ paths:
10
+ - .cache/pip
11
+ - .cache/uv
12
+
13
+ package:wheel:
14
+ stage: package
15
+ image: ${PYTHON_IMAGE}
16
+ before_script:
17
+ - echo "替换为阿里云APT源..."
18
+ - sed -i 's|deb.debian.org|mirrors.aliyun.com|g' /etc/apt/sources.list.d/debian.sources
19
+ - sed -i 's|security.debian.org|mirrors.aliyun.com|g' /etc/apt/sources.list.d/debian.sources
20
+
21
+ - echo "安装 UV 包管理器..."
22
+ - apt-get update && apt-get install -y curl
23
+ - curl -LsSf https://astral.sh/uv/install.sh | sh
24
+ - export PATH="$HOME/.local/bin:$PATH"
25
+ - source ~/.bashrc
26
+ script:
27
+ - echo "构建 Python wheel 包..."
28
+ - UV_INDEX_URL=https://pypi.tuna.tsinghua.edu.cn/simple uv sync
29
+ - uv build
30
+ - ls -lh dist/
31
+ - echo "构建完成!"
32
+ artifacts:
33
+ paths:
34
+ - dist/
35
+ expire_in: 30 days
36
+ only:
37
+ - branches
38
+ - tags
39
+ - merge_requests
@@ -0,0 +1,165 @@
1
+ Metadata-Version: 2.4
2
+ Name: xiaomi-xb
3
+ Version: 1.0.0
4
+ Summary: Project management tool for UV + FastAPI + Vue3 + Electron desktop applications
5
+ Project-URL: Homepage, https://github.com/yourusername/xb
6
+ Project-URL: Documentation, https://github.com/yourusername/xb#readme
7
+ Project-URL: Repository, https://github.com/yourusername/xb.git
8
+ Project-URL: Issues, https://github.com/yourusername/xb/issues
9
+ Author-email: XB Team <xb@example.com>
10
+ License: MIT
11
+ Keywords: cli,electron,fastapi,project-management,vue3
12
+ Classifier: Development Status :: 3 - Alpha
13
+ Classifier: Intended Audience :: Developers
14
+ Classifier: License :: OSI Approved :: MIT License
15
+ Classifier: Programming Language :: Python :: 3
16
+ Classifier: Programming Language :: Python :: 3.12
17
+ Classifier: Topic :: Software Development :: Build Tools
18
+ Requires-Python: >=3.12
19
+ Requires-Dist: click>=8.1.0
20
+ Requires-Dist: jinja2>=3.1.0
21
+ Requires-Dist: pyyaml>=6.0
22
+ Requires-Dist: rich>=13.0.0
23
+ Provides-Extra: dev
24
+ Requires-Dist: black>=23.0; extra == 'dev'
25
+ Requires-Dist: pytest>=7.0; extra == 'dev'
26
+ Requires-Dist: ruff>=0.1.0; extra == 'dev'
27
+ Description-Content-Type: text/markdown
28
+
29
+ # xb - Project Management Tool
30
+
31
+ **xb** 是一个基于 `uv` 又类似 `uv` 的项目管理工具,用于快速初始化 **UV + FastAPI + Vue3 + Electron** 桌面应用。
32
+
33
+ ## 特性
34
+
35
+ - 一键初始化完整项目结构
36
+ - UV + FastAPI + Vue3 + Electron 开箱即用
37
+ - 可选 sudo 免密配置
38
+ - 内置开发、构建、版本管理脚本
39
+
40
+ ## 安装
41
+
42
+ ```bash
43
+ # 安装 uv
44
+ curl -LsSf https://astral.sh/uv/install.sh | sh
45
+
46
+ # 安装 xb
47
+ cd xb
48
+ uv sync
49
+ uv tool install .
50
+
51
+ xb --help
52
+ ```
53
+
54
+ ## 快速开始
55
+
56
+ ```bash
57
+ # 初始化项目
58
+ xb init --package myapp
59
+
60
+ # 带 sudo 免密配置
61
+ xb init --package myapp --sudoers
62
+
63
+ cd myapp
64
+
65
+ # 启动开发环境
66
+ xb dev
67
+
68
+ # 查看状态
69
+ xb dev --status
70
+
71
+ # 停止
72
+ xb dev --stop
73
+ ```
74
+
75
+ ## 构建
76
+
77
+ ```bash
78
+ # 构建所有
79
+ xb build
80
+
81
+ # 单独构建
82
+ xb build -f # 前端
83
+ xb build -b # 后端
84
+ xb build -e # Electron DEB
85
+ ```
86
+
87
+ ## 项目结构
88
+
89
+ ```
90
+ myapp/
91
+ ├── pyproject.toml # Python 依赖 (uv)
92
+ ├── backend/ # FastAPI 后端
93
+ │ ├── main.py
94
+ │ ├── api/
95
+ │ └── managers/
96
+ ├── frontend/ # Vue 3 前端
97
+ │ └── src/
98
+ ├── electron/ # Electron 主进程
99
+ ├── version/ # 版本管理
100
+ │ ├── hooks/
101
+ │ └── scripts/
102
+ ├── configs/ # 配置文件
103
+ ├── scripts/ # 可执行脚本
104
+ ├── dev.sh # 开发脚本
105
+ ├── build.sh # 打包脚本
106
+ └── .venv # Python 虚拟环境
107
+ ```
108
+
109
+ ## 版本管理
110
+
111
+ ```bash
112
+ # 查看当前版本
113
+ xb version
114
+ ```
115
+
116
+ ## 配置
117
+
118
+ ### Sudo 免密
119
+
120
+ ```bash
121
+ # 启用 sudo 免密配置
122
+ xb init --package myapp --sudoers
123
+
124
+ # 密码存储在 configs/global_config.yaml
125
+ # 建议设置文件权限: chmod 600 configs/global_config.yaml
126
+ ```
127
+
128
+ ## 技术栈
129
+
130
+ | 组件 | 技术 |
131
+ |------|------|
132
+ | 后端 | FastAPI + Uvicorn |
133
+ | 前端 | Vue 3 + Vite |
134
+ | 桌面 | Electron |
135
+ | 构建 | PyInstaller + electron-builder |
136
+ | 依赖 | uv |
137
+
138
+ ## 环境要求
139
+
140
+ - **Python**: 3.10+
141
+ - **Node.js**: 16+
142
+ - **npm**: 8+
143
+ - **OS**: Linux
144
+
145
+ ## 许可证
146
+
147
+ MIT
148
+
149
+ ## 故障排查
150
+
151
+ ```bash
152
+ # 后端启动失败
153
+ cat datas/logs/backend.log
154
+ lsof -i :8000
155
+
156
+ # 手动启动测试
157
+ cd myapp
158
+ .venv/bin/python backend/main.py
159
+
160
+ # 前端启动失败
161
+ cat datas/logs/frontend.log
162
+ cd frontend && rm -rf node_modules && npm install
163
+ ```
164
+
165
+
@@ -0,0 +1,137 @@
1
+ # xb - Project Management Tool
2
+
3
+ **xb** 是一个基于 `uv` 又类似 `uv` 的项目管理工具,用于快速初始化 **UV + FastAPI + Vue3 + Electron** 桌面应用。
4
+
5
+ ## 特性
6
+
7
+ - 一键初始化完整项目结构
8
+ - UV + FastAPI + Vue3 + Electron 开箱即用
9
+ - 可选 sudo 免密配置
10
+ - 内置开发、构建、版本管理脚本
11
+
12
+ ## 安装
13
+
14
+ ```bash
15
+ # 安装 uv
16
+ curl -LsSf https://astral.sh/uv/install.sh | sh
17
+
18
+ # 安装 xb
19
+ cd xb
20
+ uv sync
21
+ uv tool install .
22
+
23
+ xb --help
24
+ ```
25
+
26
+ ## 快速开始
27
+
28
+ ```bash
29
+ # 初始化项目
30
+ xb init --package myapp
31
+
32
+ # 带 sudo 免密配置
33
+ xb init --package myapp --sudoers
34
+
35
+ cd myapp
36
+
37
+ # 启动开发环境
38
+ xb dev
39
+
40
+ # 查看状态
41
+ xb dev --status
42
+
43
+ # 停止
44
+ xb dev --stop
45
+ ```
46
+
47
+ ## 构建
48
+
49
+ ```bash
50
+ # 构建所有
51
+ xb build
52
+
53
+ # 单独构建
54
+ xb build -f # 前端
55
+ xb build -b # 后端
56
+ xb build -e # Electron DEB
57
+ ```
58
+
59
+ ## 项目结构
60
+
61
+ ```
62
+ myapp/
63
+ ├── pyproject.toml # Python 依赖 (uv)
64
+ ├── backend/ # FastAPI 后端
65
+ │ ├── main.py
66
+ │ ├── api/
67
+ │ └── managers/
68
+ ├── frontend/ # Vue 3 前端
69
+ │ └── src/
70
+ ├── electron/ # Electron 主进程
71
+ ├── version/ # 版本管理
72
+ │ ├── hooks/
73
+ │ └── scripts/
74
+ ├── configs/ # 配置文件
75
+ ├── scripts/ # 可执行脚本
76
+ ├── dev.sh # 开发脚本
77
+ ├── build.sh # 打包脚本
78
+ └── .venv # Python 虚拟环境
79
+ ```
80
+
81
+ ## 版本管理
82
+
83
+ ```bash
84
+ # 查看当前版本
85
+ xb version
86
+ ```
87
+
88
+ ## 配置
89
+
90
+ ### Sudo 免密
91
+
92
+ ```bash
93
+ # 启用 sudo 免密配置
94
+ xb init --package myapp --sudoers
95
+
96
+ # 密码存储在 configs/global_config.yaml
97
+ # 建议设置文件权限: chmod 600 configs/global_config.yaml
98
+ ```
99
+
100
+ ## 技术栈
101
+
102
+ | 组件 | 技术 |
103
+ |------|------|
104
+ | 后端 | FastAPI + Uvicorn |
105
+ | 前端 | Vue 3 + Vite |
106
+ | 桌面 | Electron |
107
+ | 构建 | PyInstaller + electron-builder |
108
+ | 依赖 | uv |
109
+
110
+ ## 环境要求
111
+
112
+ - **Python**: 3.10+
113
+ - **Node.js**: 16+
114
+ - **npm**: 8+
115
+ - **OS**: Linux
116
+
117
+ ## 许可证
118
+
119
+ MIT
120
+
121
+ ## 故障排查
122
+
123
+ ```bash
124
+ # 后端启动失败
125
+ cat datas/logs/backend.log
126
+ lsof -i :8000
127
+
128
+ # 手动启动测试
129
+ cd myapp
130
+ .venv/bin/python backend/main.py
131
+
132
+ # 前端启动失败
133
+ cat datas/logs/frontend.log
134
+ cd frontend && rm -rf node_modules && npm install
135
+ ```
136
+
137
+
@@ -0,0 +1,61 @@
1
+ [build-system]
2
+ requires = ["hatchling"]
3
+ build-backend = "hatchling.build"
4
+
5
+ [project]
6
+ name = "xiaomi-xb"
7
+ version = "1.0.0"
8
+ description = "Project management tool for UV + FastAPI + Vue3 + Electron desktop applications"
9
+ readme = "README.md"
10
+ requires-python = ">=3.12"
11
+ license = {text = "MIT"}
12
+ authors = [
13
+ {name = "XB Team", email = "xb@example.com"}
14
+ ]
15
+ keywords = ["electron", "fastapi", "vue3", "project-management", "cli"]
16
+ classifiers = [
17
+ "Development Status :: 3 - Alpha",
18
+ "Intended Audience :: Developers",
19
+ "License :: OSI Approved :: MIT License",
20
+ "Programming Language :: Python :: 3",
21
+ "Programming Language :: Python :: 3.12",
22
+ "Topic :: Software Development :: Build Tools",
23
+ ]
24
+
25
+ dependencies = [
26
+ "click>=8.1.0",
27
+ "jinja2>=3.1.0",
28
+ "pyyaml>=6.0",
29
+ "rich>=13.0.0",
30
+ ]
31
+
32
+ [project.optional-dependencies]
33
+ dev = [
34
+ "pytest>=7.0",
35
+ "black>=23.0",
36
+ "ruff>=0.1.0",
37
+ ]
38
+
39
+ [project.scripts]
40
+ xb = "xb.cli:main"
41
+
42
+ [project.urls]
43
+ Homepage = "https://github.com/yourusername/xb"
44
+ Documentation = "https://github.com/yourusername/xb#readme"
45
+ Repository = "https://github.com/yourusername/xb.git"
46
+ Issues = "https://github.com/yourusername/xb/issues"
47
+
48
+ [tool.hatch.build.targets.wheel]
49
+ packages = ["xb"]
50
+
51
+ [tool.black]
52
+ line-length = 100
53
+ target-version = ['py310']
54
+
55
+ [tool.ruff]
56
+ line-length = 100
57
+ target-version = "py310"
58
+
59
+ [tool.ruff.lint]
60
+ select = ["E", "F", "I", "N", "W", "B"]
61
+ ignore = ["E501"]
@@ -0,0 +1,5 @@
1
+ """
2
+ xb - Project management tool for UV + FastAPI + Vue3 + Electron desktop applications
3
+ """
4
+
5
+ __version__ = "0.0.0"
@@ -0,0 +1,55 @@
1
+ """
2
+ xb CLI 入口
3
+ 提供项目初始化、开发、构建等命令
4
+ """
5
+
6
+ import click
7
+ from rich.console import Console
8
+
9
+ from .commands.build import build
10
+ from .commands.dev import dev
11
+ from .commands.init import XbGroup, init_command
12
+ from .commands.version import version
13
+
14
+ console = Console()
15
+
16
+
17
+ class ColorfulXbGroup(XbGroup):
18
+ def format_help(self, ctx, formatter):
19
+ console.print(
20
+ "\n[bold green]Usage:[/bold green] [cyan]xb [OPTIONS] COMMAND [ARGS]...[/cyan]\n"
21
+ )
22
+ console.print("[dim]xb - UV + FastAPI + Vue3 + Electron 桌面应用项目管理工具[/dim]")
23
+ console.print("[dim]类似 uv,专为 Electron 桌面应用设计。[/dim]\n")
24
+ console.print("[bold green]Options:[/bold green]")
25
+ console.print(" [cyan]--version[/cyan] Show the version and exit.")
26
+ console.print(" [cyan]--help[/cyan] Show this message and exit.\n")
27
+ console.print("[bold green]Commands:[/bold green]")
28
+ for subcommand in self.list_commands(ctx):
29
+ cmd = self.get_command(ctx, subcommand)
30
+ if cmd is None:
31
+ continue
32
+ help_text = cmd.get_short_help_str()
33
+ console.print(f" [cyan]{subcommand:<10}[/cyan] {help_text}")
34
+ console.print()
35
+
36
+
37
+ @click.group(cls=ColorfulXbGroup)
38
+ @click.version_option(version="0.1.0", prog_name="xb")
39
+ def main():
40
+ """
41
+ xb - UV + FastAPI + Vue3 + Electron 桌面应用项目管理工具
42
+
43
+ 类似 uv,专为 Electron 桌面应用设计。
44
+ """
45
+ pass
46
+
47
+
48
+ main.add_command(init_command, name="init")
49
+ main.add_command(dev, name="dev")
50
+ main.add_command(build, name="build")
51
+ main.add_command(version, name="version")
52
+
53
+
54
+ if __name__ == "__main__":
55
+ main()
@@ -0,0 +1 @@
1
+ """xb commands package"""
@@ -0,0 +1,62 @@
1
+ """
2
+ xb build 命令实现
3
+ 构建项目
4
+ """
5
+
6
+ import subprocess
7
+ from pathlib import Path
8
+
9
+ import click
10
+
11
+
12
+ def is_project_root(path: Path) -> bool:
13
+ return (path / "pyproject.toml").exists() and (path / "build.sh").exists()
14
+
15
+
16
+ def find_project_root() -> Path:
17
+ cwd = Path.cwd()
18
+ for path in [cwd] + list(cwd.parents):
19
+ if is_project_root(path):
20
+ return path
21
+ return None
22
+
23
+
24
+ @click.command()
25
+ @click.option(
26
+ "-f",
27
+ "--frontend",
28
+ is_flag=True,
29
+ default=False,
30
+ help="只构建前端",
31
+ )
32
+ @click.option(
33
+ "-b",
34
+ "--backend",
35
+ is_flag=True,
36
+ default=False,
37
+ help="只构建后端",
38
+ )
39
+ @click.option(
40
+ "-e",
41
+ "--electron",
42
+ is_flag=True,
43
+ default=False,
44
+ help="只构建 Electron DEB",
45
+ )
46
+ def build(frontend: bool, backend: bool, electron: bool):
47
+ """构建项目"""
48
+ project_root = find_project_root()
49
+ if not project_root:
50
+ click.echo("❌ 未找到项目根目录(缺少 pyproject.toml 或 build.sh)")
51
+ raise click.Abort()
52
+
53
+ build_script = project_root / "build.sh"
54
+
55
+ if frontend:
56
+ subprocess.run(["bash", str(build_script), "-f"], cwd=project_root)
57
+ elif backend:
58
+ subprocess.run(["bash", str(build_script), "-b"], cwd=project_root)
59
+ elif electron:
60
+ subprocess.run(["bash", str(build_script), "-e"], cwd=project_root)
61
+ else:
62
+ subprocess.run(["bash", str(build_script), "-a"], cwd=project_root)
@@ -0,0 +1,51 @@
1
+ """
2
+ xb dev 命令实现
3
+ 启动/停止开发环境
4
+ """
5
+
6
+ import subprocess
7
+ from pathlib import Path
8
+
9
+ import click
10
+
11
+
12
+ def is_project_root(path: Path) -> bool:
13
+ return (path / "pyproject.toml").exists() and (path / "dev.sh").exists()
14
+
15
+
16
+ def find_project_root() -> Path:
17
+ cwd = Path.cwd()
18
+ for path in [cwd] + list(cwd.parents):
19
+ if is_project_root(path):
20
+ return path
21
+ return None
22
+
23
+
24
+ @click.command()
25
+ @click.option(
26
+ "--stop",
27
+ is_flag=True,
28
+ default=False,
29
+ help="停止开发环境",
30
+ )
31
+ @click.option(
32
+ "--status",
33
+ is_flag=True,
34
+ default=False,
35
+ help="查看运行状态",
36
+ )
37
+ def dev(stop: bool, status: bool):
38
+ """启动/停止开发环境"""
39
+ project_root = find_project_root()
40
+ if not project_root:
41
+ click.echo("❌ 未找到项目根目录(缺少 pyproject.toml 或 dev.sh)")
42
+ raise click.Abort()
43
+
44
+ dev_script = project_root / "dev.sh"
45
+
46
+ if stop:
47
+ subprocess.run(["bash", str(dev_script), "stop"], cwd=project_root)
48
+ elif status:
49
+ subprocess.run(["bash", str(dev_script), "status"], cwd=project_root)
50
+ else:
51
+ subprocess.run(["bash", str(dev_script), "start"], cwd=project_root)