mspec-cli 4.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 (30) hide show
  1. mspec_cli-4.0.0/LICENSE +21 -0
  2. mspec_cli-4.0.0/MANIFEST.in +4 -0
  3. mspec_cli-4.0.0/PKG-INFO +281 -0
  4. mspec_cli-4.0.0/README.md +242 -0
  5. mspec_cli-4.0.0/pyproject.toml +68 -0
  6. mspec_cli-4.0.0/setup.cfg +4 -0
  7. mspec_cli-4.0.0/src/mspec/__init__.py +5 -0
  8. mspec_cli-4.0.0/src/mspec/__main__.py +7 -0
  9. mspec_cli-4.0.0/src/mspec/cli.py +44 -0
  10. mspec_cli-4.0.0/src/mspec/commands/__init__.py +7 -0
  11. mspec_cli-4.0.0/src/mspec/commands/doctor.py +132 -0
  12. mspec_cli-4.0.0/src/mspec/commands/init.py +157 -0
  13. mspec_cli-4.0.0/src/mspec/commands/update.py +104 -0
  14. mspec_cli-4.0.0/src/mspec/core/__init__.py +6 -0
  15. mspec_cli-4.0.0/src/mspec/core/config.py +141 -0
  16. mspec_cli-4.0.0/src/mspec/core/template.py +131 -0
  17. mspec_cli-4.0.0/src/mspec/templates/config.yaml +187 -0
  18. mspec_cli-4.0.0/src/mspec/templates/design-issue-taxonomy.md +180 -0
  19. mspec_cli-4.0.0/src/mspec/templates/design-issues.md +218 -0
  20. mspec_cli-4.0.0/src/mspec/templates/requirement-issue-taxonomy.md +155 -0
  21. mspec_cli-4.0.0/src/mspec/templates/requirement-issues.md +214 -0
  22. mspec_cli-4.0.0/src/mspec/utils/__init__.py +17 -0
  23. mspec_cli-4.0.0/src/mspec/utils/console.py +39 -0
  24. mspec_cli-4.0.0/src/mspec_cli.egg-info/PKG-INFO +281 -0
  25. mspec_cli-4.0.0/src/mspec_cli.egg-info/SOURCES.txt +28 -0
  26. mspec_cli-4.0.0/src/mspec_cli.egg-info/dependency_links.txt +1 -0
  27. mspec_cli-4.0.0/src/mspec_cli.egg-info/entry_points.txt +2 -0
  28. mspec_cli-4.0.0/src/mspec_cli.egg-info/requires.txt +15 -0
  29. mspec_cli-4.0.0/src/mspec_cli.egg-info/top_level.txt +1 -0
  30. mspec_cli-4.0.0/tests/test_init.py +24 -0
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 mspec Team
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
@@ -0,0 +1,4 @@
1
+ include README.md
2
+ include LICENSE
3
+ include pyproject.toml
4
+ recursive-include src/mspec/templates *.yaml *.md
@@ -0,0 +1,281 @@
1
+ Metadata-Version: 2.4
2
+ Name: mspec-cli
3
+ Version: 4.0.0
4
+ Summary: m-spec - 成员规范驱动开发工作流 CLI 工具
5
+ Author-email: shirayner <team@mspec.io>
6
+ License: MIT
7
+ Project-URL: Homepage, https://github.com/mspec-dev/mspec
8
+ Project-URL: Documentation, https://github.com/mspec-dev/mspec#readme
9
+ Project-URL: Repository, https://github.com/mspec-dev/mspec.git
10
+ Project-URL: Issues, https://github.com/mspec-dev/mspec/issues
11
+ Keywords: spec,workflow,cli,development,m-spec
12
+ Classifier: Development Status :: 4 - Beta
13
+ Classifier: Intended Audience :: Developers
14
+ Classifier: License :: OSI Approved :: MIT License
15
+ Classifier: Programming Language :: Python :: 3
16
+ Classifier: Programming Language :: Python :: 3.8
17
+ Classifier: Programming Language :: Python :: 3.9
18
+ Classifier: Programming Language :: Python :: 3.10
19
+ Classifier: Programming Language :: Python :: 3.11
20
+ Classifier: Programming Language :: Python :: 3.12
21
+ Requires-Python: >=3.8
22
+ Description-Content-Type: text/markdown
23
+ License-File: LICENSE
24
+ Requires-Dist: click>=8.0.0
25
+ Requires-Dist: rich>=13.0.0
26
+ Requires-Dist: requests>=2.28.0
27
+ Requires-Dist: pydantic>=2.0.0
28
+ Requires-Dist: pyyaml>=6.0
29
+ Requires-Dist: semver>=3.0.0
30
+ Requires-Dist: questionary>=2.0.0
31
+ Provides-Extra: dev
32
+ Requires-Dist: pytest>=7.0.0; extra == "dev"
33
+ Requires-Dist: pytest-cov>=4.0.0; extra == "dev"
34
+ Requires-Dist: black>=23.0.0; extra == "dev"
35
+ Requires-Dist: isort>=5.12.0; extra == "dev"
36
+ Requires-Dist: mypy>=1.0.0; extra == "dev"
37
+ Requires-Dist: flake8>=6.0.0; extra == "dev"
38
+ Dynamic: license-file
39
+
40
+ # mspec
41
+
42
+ [![PyPI version](https://badge.fury.io/py/mspec.svg)](https://badge.fury.io/py/mspec)
43
+ [![Python version](https://img.shields.io/pypi/pyversions/mspec.svg)](https://pypi.org/project/mspec/)
44
+ [![License](https://img.shields.io/badge/license-MIT-blue.svg)](LICENSE)
45
+
46
+ **mspec** - 成员规范驱动开发工作流 CLI 工具
47
+
48
+ 通过交互式命令行澄清机制,实现结构化问题发现与澄清,提升需求明确度和开发效率。
49
+
50
+ ## 特性
51
+
52
+ - 🚀 **一键安装** - `pip install mspec` 即可使用
53
+ - 🔄 **交互式澄清** - 一问一答的引导式交互界面
54
+ - 💾 **断点续传** - 支持随时中断,下次自动恢复
55
+ - 📚 **结构化问题分类** - 6个需求维度 + 7个设计维度
56
+ - 🎨 **美观界面** - 使用 Rich 库提供彩色终端输出
57
+
58
+ ## 文档
59
+
60
+ - [EVOLUTION.md](docs/EVOLUTION.md) - mspec 演进历程 (v1 → v4)
61
+ - [SPEC-ARCHIVE.md](docs/SPEC-ARCHIVE.md) - 完整技术规范参考
62
+
63
+ ## 快速开始
64
+
65
+ ### 安装
66
+
67
+ ```bash
68
+ pip install mspec
69
+ ```
70
+
71
+ ### 初始化项目
72
+
73
+ ```bash
74
+ # 进入项目目录
75
+ cd my-project
76
+
77
+ # 初始化 mspec 配置
78
+ mspec init
79
+ ```
80
+
81
+ ### 检查环境
82
+
83
+ ```bash
84
+ mspec doctor
85
+ ```
86
+
87
+ ### 更新模板
88
+
89
+ ```bash
90
+ mspec update
91
+ ```
92
+
93
+ ## 命令说明
94
+
95
+ ### `mspec init [path]`
96
+
97
+ 初始化 mspec 项目配置
98
+
99
+ **选项:**
100
+ - `--template, -t <url>` - 使用自定义模板仓库
101
+ - `--force, -f` - 强制覆盖已有配置
102
+ - `--dry-run` - 模拟运行,不实际创建文件
103
+ - `--yes, -y` - 跳过确认,使用默认配置
104
+
105
+ **示例:**
106
+ ```bash
107
+ mspec init # 初始化当前目录
108
+ mspec init ./my-project # 初始化指定目录
109
+ mspec init --force # 强制覆盖已有配置
110
+ mspec init --template https://github.com/your-org/mspec-template
111
+ ```
112
+
113
+ ### `mspec update`
114
+
115
+ 更新模板到最新版本
116
+
117
+ **选项:**
118
+ - `--check` - 仅检查更新,不执行更新
119
+
120
+ **示例:**
121
+ ```bash
122
+ mspec update # 更新到最新版本
123
+ mspec update --check # 仅检查是否有更新
124
+ ```
125
+
126
+ ### `mspec doctor`
127
+
128
+ 诊断环境配置
129
+
130
+ **示例:**
131
+ ```bash
132
+ mspec doctor
133
+ ```
134
+
135
+ ## 工作流
136
+
137
+ ```
138
+ 需求输入
139
+
140
+
141
+ ┌─────────────────────────────────────┐
142
+ │ 阶段 1: 需求澄清 (交互式) │
143
+ │ - 生成 requirement-issues.md │
144
+ │ - 交互式澄清 High/Medium 问题 │
145
+ └─────────────────────────────────────┘
146
+
147
+
148
+ ┌─────────────────────────────────────┐
149
+ │ 阶段 2: 提案创建 │
150
+ │ - 创建 proposal.md │
151
+ └─────────────────────────────────────┘
152
+
153
+
154
+ ┌─────────────────────────────────────┐
155
+ │ 阶段 3: 规格定义 │
156
+ │ - 创建 specs/*.md │
157
+ └─────────────────────────────────────┘
158
+
159
+
160
+ ┌─────────────────────────────────────┐
161
+ │ 阶段 4: 技术方案 │
162
+ │ - 创建 design.md │
163
+ └─────────────────────────────────────┘
164
+
165
+
166
+ ┌─────────────────────────────────────┐
167
+ │ 阶段 5: 设计澄清 (交互式) │
168
+ │ - 生成 design-issues.md │
169
+ │ - 交互式澄清 High/Medium 问题 │
170
+ └─────────────────────────────────────┘
171
+
172
+
173
+ ┌─────────────────────────────────────┐
174
+ │ 阶段 6: 任务创建 │
175
+ │ - 创建 tasks.md │
176
+ └─────────────────────────────────────┘
177
+
178
+
179
+ 实施 (apply)
180
+ ```
181
+
182
+ ## 问题分类学
183
+
184
+ ### 需求问题 (6个维度)
185
+
186
+ 1. **功能完整性** - 功能边界、流程、依赖
187
+ 2. **数据相关** - 数据定义、量级、一致性
188
+ 3. **用户体验** - 用户场景、交互、性能
189
+ 4. **边界与异常** - 边界条件、异常场景、权限
190
+ 5. **集成与依赖** - 外部系统、内部模块、环境
191
+ 6. **优先级与范围** - 必需vs可选、时间、资源
192
+
193
+ ### 设计问题 (7个维度)
194
+
195
+ 1. **架构决策** - 架构方案、服务边界、扩展性
196
+ 2. **技术选型** - 框架、数据库、中间件
197
+ 3. **接口设计** - API契约、数据流、异步处理
198
+ 4. **数据与状态** - 数据模型、状态机、迁移
199
+ 5. **安全与合规** - 认证授权、数据安全、审计
200
+ 6. **性能与可靠性** - 性能瓶颈、缓存、降级熔断
201
+ 7. **部署与运维** - 部署方案、监控告警、配置管理
202
+
203
+ ## 交互式澄清
204
+
205
+ ```
206
+ =================================================================
207
+ 📋 问题 [3/8] - 功能点: 用户管理
208
+ =================================================================
209
+
210
+ ❓ 问题:用户资料需要包含哪些字段?
211
+
212
+ 💡 说明:
213
+ 当前需求中"用户资料"范围不明确,需要明确包含哪些
214
+ 必填字段和选填字段,这将影响数据库设计和前端表单开发。
215
+
216
+ 🔘 备选选项:
217
+
218
+ A) 基础版:用户名、邮箱、手机号
219
+ B) 标准版:用户名、邮箱、手机号、头像、昵称
220
+ C) 完整版:用户名、邮箱、手机号、头像、昵称、
221
+ 部门、职位、入职日期
222
+ D) 自定义...
223
+
224
+ ✏️ 你的选择:
225
+ =================================================================
226
+ ```
227
+
228
+ **操作指令:**
229
+ - `A`, `B`, `C`, `D`... - 选择对应选项
230
+ - `E` 或最后一个选项 - 选择自定义输入模式
231
+ - `q` - 退出保存,下次自动恢复
232
+ - `s` - 跳过当前问题(仅 Low 优先级)
233
+
234
+ ## 配置
235
+
236
+ mspec 配置文件位于 `openspec/config.yaml`,包含:
237
+
238
+ - 问题分类学引用
239
+ - 交互式澄清配置
240
+ - 各阶段规则定义
241
+
242
+ ## 开发
243
+
244
+ ```bash
245
+ # 克隆仓库
246
+ git clone https://github.com/mspec-dev/mspec.git
247
+ cd mspec
248
+
249
+ # 创建虚拟环境
250
+ python -m venv venv
251
+ source venv/bin/activate # Linux/Mac
252
+ # 或
253
+ venv\Scripts\activate # Windows
254
+
255
+ # 安装依赖
256
+ pip install -e ".[dev]"
257
+
258
+ # 运行测试
259
+ pytest
260
+
261
+ # 格式化代码
262
+ black src/
263
+ isort src/
264
+
265
+ # 类型检查
266
+ mypy src/
267
+ ```
268
+
269
+ ## 许可证
270
+
271
+ [MIT](LICENSE)
272
+
273
+ ## 贡献
274
+
275
+ 欢迎提交 Issue 和 PR!
276
+
277
+ ## 相关链接
278
+
279
+ - [GitHub](https://github.com/mspec-dev/mspec)
280
+ - [PyPI](https://pypi.org/project/mspec/)
281
+ - [文档](https://docs.mspec.io)
@@ -0,0 +1,242 @@
1
+ # mspec
2
+
3
+ [![PyPI version](https://badge.fury.io/py/mspec.svg)](https://badge.fury.io/py/mspec)
4
+ [![Python version](https://img.shields.io/pypi/pyversions/mspec.svg)](https://pypi.org/project/mspec/)
5
+ [![License](https://img.shields.io/badge/license-MIT-blue.svg)](LICENSE)
6
+
7
+ **mspec** - 成员规范驱动开发工作流 CLI 工具
8
+
9
+ 通过交互式命令行澄清机制,实现结构化问题发现与澄清,提升需求明确度和开发效率。
10
+
11
+ ## 特性
12
+
13
+ - 🚀 **一键安装** - `pip install mspec` 即可使用
14
+ - 🔄 **交互式澄清** - 一问一答的引导式交互界面
15
+ - 💾 **断点续传** - 支持随时中断,下次自动恢复
16
+ - 📚 **结构化问题分类** - 6个需求维度 + 7个设计维度
17
+ - 🎨 **美观界面** - 使用 Rich 库提供彩色终端输出
18
+
19
+ ## 文档
20
+
21
+ - [EVOLUTION.md](docs/EVOLUTION.md) - mspec 演进历程 (v1 → v4)
22
+ - [SPEC-ARCHIVE.md](docs/SPEC-ARCHIVE.md) - 完整技术规范参考
23
+
24
+ ## 快速开始
25
+
26
+ ### 安装
27
+
28
+ ```bash
29
+ pip install mspec
30
+ ```
31
+
32
+ ### 初始化项目
33
+
34
+ ```bash
35
+ # 进入项目目录
36
+ cd my-project
37
+
38
+ # 初始化 mspec 配置
39
+ mspec init
40
+ ```
41
+
42
+ ### 检查环境
43
+
44
+ ```bash
45
+ mspec doctor
46
+ ```
47
+
48
+ ### 更新模板
49
+
50
+ ```bash
51
+ mspec update
52
+ ```
53
+
54
+ ## 命令说明
55
+
56
+ ### `mspec init [path]`
57
+
58
+ 初始化 mspec 项目配置
59
+
60
+ **选项:**
61
+ - `--template, -t <url>` - 使用自定义模板仓库
62
+ - `--force, -f` - 强制覆盖已有配置
63
+ - `--dry-run` - 模拟运行,不实际创建文件
64
+ - `--yes, -y` - 跳过确认,使用默认配置
65
+
66
+ **示例:**
67
+ ```bash
68
+ mspec init # 初始化当前目录
69
+ mspec init ./my-project # 初始化指定目录
70
+ mspec init --force # 强制覆盖已有配置
71
+ mspec init --template https://github.com/your-org/mspec-template
72
+ ```
73
+
74
+ ### `mspec update`
75
+
76
+ 更新模板到最新版本
77
+
78
+ **选项:**
79
+ - `--check` - 仅检查更新,不执行更新
80
+
81
+ **示例:**
82
+ ```bash
83
+ mspec update # 更新到最新版本
84
+ mspec update --check # 仅检查是否有更新
85
+ ```
86
+
87
+ ### `mspec doctor`
88
+
89
+ 诊断环境配置
90
+
91
+ **示例:**
92
+ ```bash
93
+ mspec doctor
94
+ ```
95
+
96
+ ## 工作流
97
+
98
+ ```
99
+ 需求输入
100
+
101
+
102
+ ┌─────────────────────────────────────┐
103
+ │ 阶段 1: 需求澄清 (交互式) │
104
+ │ - 生成 requirement-issues.md │
105
+ │ - 交互式澄清 High/Medium 问题 │
106
+ └─────────────────────────────────────┘
107
+
108
+
109
+ ┌─────────────────────────────────────┐
110
+ │ 阶段 2: 提案创建 │
111
+ │ - 创建 proposal.md │
112
+ └─────────────────────────────────────┘
113
+
114
+
115
+ ┌─────────────────────────────────────┐
116
+ │ 阶段 3: 规格定义 │
117
+ │ - 创建 specs/*.md │
118
+ └─────────────────────────────────────┘
119
+
120
+
121
+ ┌─────────────────────────────────────┐
122
+ │ 阶段 4: 技术方案 │
123
+ │ - 创建 design.md │
124
+ └─────────────────────────────────────┘
125
+
126
+
127
+ ┌─────────────────────────────────────┐
128
+ │ 阶段 5: 设计澄清 (交互式) │
129
+ │ - 生成 design-issues.md │
130
+ │ - 交互式澄清 High/Medium 问题 │
131
+ └─────────────────────────────────────┘
132
+
133
+
134
+ ┌─────────────────────────────────────┐
135
+ │ 阶段 6: 任务创建 │
136
+ │ - 创建 tasks.md │
137
+ └─────────────────────────────────────┘
138
+
139
+
140
+ 实施 (apply)
141
+ ```
142
+
143
+ ## 问题分类学
144
+
145
+ ### 需求问题 (6个维度)
146
+
147
+ 1. **功能完整性** - 功能边界、流程、依赖
148
+ 2. **数据相关** - 数据定义、量级、一致性
149
+ 3. **用户体验** - 用户场景、交互、性能
150
+ 4. **边界与异常** - 边界条件、异常场景、权限
151
+ 5. **集成与依赖** - 外部系统、内部模块、环境
152
+ 6. **优先级与范围** - 必需vs可选、时间、资源
153
+
154
+ ### 设计问题 (7个维度)
155
+
156
+ 1. **架构决策** - 架构方案、服务边界、扩展性
157
+ 2. **技术选型** - 框架、数据库、中间件
158
+ 3. **接口设计** - API契约、数据流、异步处理
159
+ 4. **数据与状态** - 数据模型、状态机、迁移
160
+ 5. **安全与合规** - 认证授权、数据安全、审计
161
+ 6. **性能与可靠性** - 性能瓶颈、缓存、降级熔断
162
+ 7. **部署与运维** - 部署方案、监控告警、配置管理
163
+
164
+ ## 交互式澄清
165
+
166
+ ```
167
+ =================================================================
168
+ 📋 问题 [3/8] - 功能点: 用户管理
169
+ =================================================================
170
+
171
+ ❓ 问题:用户资料需要包含哪些字段?
172
+
173
+ 💡 说明:
174
+ 当前需求中"用户资料"范围不明确,需要明确包含哪些
175
+ 必填字段和选填字段,这将影响数据库设计和前端表单开发。
176
+
177
+ 🔘 备选选项:
178
+
179
+ A) 基础版:用户名、邮箱、手机号
180
+ B) 标准版:用户名、邮箱、手机号、头像、昵称
181
+ C) 完整版:用户名、邮箱、手机号、头像、昵称、
182
+ 部门、职位、入职日期
183
+ D) 自定义...
184
+
185
+ ✏️ 你的选择:
186
+ =================================================================
187
+ ```
188
+
189
+ **操作指令:**
190
+ - `A`, `B`, `C`, `D`... - 选择对应选项
191
+ - `E` 或最后一个选项 - 选择自定义输入模式
192
+ - `q` - 退出保存,下次自动恢复
193
+ - `s` - 跳过当前问题(仅 Low 优先级)
194
+
195
+ ## 配置
196
+
197
+ mspec 配置文件位于 `openspec/config.yaml`,包含:
198
+
199
+ - 问题分类学引用
200
+ - 交互式澄清配置
201
+ - 各阶段规则定义
202
+
203
+ ## 开发
204
+
205
+ ```bash
206
+ # 克隆仓库
207
+ git clone https://github.com/mspec-dev/mspec.git
208
+ cd mspec
209
+
210
+ # 创建虚拟环境
211
+ python -m venv venv
212
+ source venv/bin/activate # Linux/Mac
213
+ # 或
214
+ venv\Scripts\activate # Windows
215
+
216
+ # 安装依赖
217
+ pip install -e ".[dev]"
218
+
219
+ # 运行测试
220
+ pytest
221
+
222
+ # 格式化代码
223
+ black src/
224
+ isort src/
225
+
226
+ # 类型检查
227
+ mypy src/
228
+ ```
229
+
230
+ ## 许可证
231
+
232
+ [MIT](LICENSE)
233
+
234
+ ## 贡献
235
+
236
+ 欢迎提交 Issue 和 PR!
237
+
238
+ ## 相关链接
239
+
240
+ - [GitHub](https://github.com/mspec-dev/mspec)
241
+ - [PyPI](https://pypi.org/project/mspec/)
242
+ - [文档](https://docs.mspec.io)
@@ -0,0 +1,68 @@
1
+ [build-system]
2
+ requires = ["setuptools>=61.0", "wheel"]
3
+ build-backend = "setuptools.build_meta"
4
+
5
+ [project]
6
+ name = "mspec-cli"
7
+ version = "4.0.0"
8
+ description = "m-spec - 成员规范驱动开发工作流 CLI 工具"
9
+ readme = "README.md"
10
+ license = {text = "MIT"}
11
+ authors = [
12
+ {name = "shirayner", email = "team@mspec.io"}
13
+ ]
14
+ keywords = ["spec", "workflow", "cli", "development", "m-spec"]
15
+ classifiers = [
16
+ "Development Status :: 4 - Beta",
17
+ "Intended Audience :: Developers",
18
+ "License :: OSI Approved :: MIT License",
19
+ "Programming Language :: Python :: 3",
20
+ "Programming Language :: Python :: 3.8",
21
+ "Programming Language :: Python :: 3.9",
22
+ "Programming Language :: Python :: 3.10",
23
+ "Programming Language :: Python :: 3.11",
24
+ "Programming Language :: Python :: 3.12",
25
+ ]
26
+ requires-python = ">=3.8"
27
+ dependencies = [
28
+ "click>=8.0.0",
29
+ "rich>=13.0.0",
30
+ "requests>=2.28.0",
31
+ "pydantic>=2.0.0",
32
+ "pyyaml>=6.0",
33
+ "semver>=3.0.0",
34
+ "questionary>=2.0.0",
35
+ ]
36
+
37
+ [project.optional-dependencies]
38
+ dev = [
39
+ "pytest>=7.0.0",
40
+ "pytest-cov>=4.0.0",
41
+ "black>=23.0.0",
42
+ "isort>=5.12.0",
43
+ "mypy>=1.0.0",
44
+ "flake8>=6.0.0",
45
+ ]
46
+
47
+ [project.scripts]
48
+ mspec = "mspec.cli:main"
49
+
50
+ [project.urls]
51
+ Homepage = "https://github.com/mspec-dev/mspec"
52
+ Documentation = "https://github.com/mspec-dev/mspec#readme"
53
+ Repository = "https://github.com/mspec-dev/mspec.git"
54
+ Issues = "https://github.com/mspec-dev/mspec/issues"
55
+
56
+ [tool.setuptools.packages.find]
57
+ where = ["src"]
58
+
59
+ [tool.setuptools.package-data]
60
+ mspec = ["templates/*"]
61
+
62
+ [tool.black]
63
+ line-length = 100
64
+ target-version = ['py38']
65
+
66
+ [tool.isort]
67
+ profile = "black"
68
+ line_length = 100
@@ -0,0 +1,4 @@
1
+ [egg_info]
2
+ tag_build =
3
+ tag_date = 0
4
+
@@ -0,0 +1,5 @@
1
+ """mspec - 成员规范驱动开发工作流 CLI 工具"""
2
+
3
+ __version__ = "4.0.0"
4
+ __author__ = "mspec Team"
5
+ __email__ = "team@mspec.io"
@@ -0,0 +1,7 @@
1
+ #!/usr/bin/env python3
2
+ """mspec CLI 入口点"""
3
+
4
+ from mspec.cli import main
5
+
6
+ if __name__ == "__main__":
7
+ main()
@@ -0,0 +1,44 @@
1
+ #!/usr/bin/env python3
2
+ """mspec CLI 入口"""
3
+
4
+ import click
5
+ from rich.console import Console
6
+
7
+ from mspec.commands import doctor, init, update
8
+ from mspec.utils.console import print_banner
9
+
10
+ console = Console()
11
+
12
+
13
+ @click.group()
14
+ @click.version_option(version="4.0.0", prog_name="mspec")
15
+ @click.option("--verbose", "-v", is_flag=True, help="显示详细日志")
16
+ @click.pass_context
17
+ def cli(ctx: click.Context, verbose: bool) -> None:
18
+ """mspec - 成员规范驱动开发工作流 CLI 工具
19
+
20
+ 快速开始:
21
+ mspec init 初始化项目配置
22
+ mspec doctor 检查环境配置
23
+ mspec update 更新模板到最新版本
24
+
25
+ 更多信息: https://github.com/mspec-dev/mspec
26
+ """
27
+ ctx.ensure_object(dict)
28
+ ctx.obj["verbose"] = verbose
29
+
30
+
31
+ # 注册命令
32
+ cli.add_command(init.init_cmd)
33
+ cli.add_command(update.update_cmd)
34
+ cli.add_command(doctor.doctor_cmd)
35
+
36
+
37
+ def main() -> None:
38
+ """主入口函数"""
39
+ print_banner()
40
+ cli()
41
+
42
+
43
+ if __name__ == "__main__":
44
+ main()
@@ -0,0 +1,7 @@
1
+ """mspec 命令模块"""
2
+
3
+ from mspec.commands.doctor import doctor_cmd
4
+ from mspec.commands.init import init_cmd
5
+ from mspec.commands.update import update_cmd
6
+
7
+ __all__ = ["init_cmd", "update_cmd", "doctor_cmd"]