mspec-cli 4.0.5__tar.gz → 4.0.6__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.
- {mspec_cli-4.0.5/src/mspec_cli.egg-info → mspec_cli-4.0.6}/PKG-INFO +1 -1
- {mspec_cli-4.0.5 → mspec_cli-4.0.6}/pyproject.toml +1 -1
- {mspec_cli-4.0.5 → mspec_cli-4.0.6}/src/mspec/commands/init.py +3 -6
- {mspec_cli-4.0.5 → mspec_cli-4.0.6}/src/mspec/core/openspec_manager.py +15 -7
- {mspec_cli-4.0.5 → mspec_cli-4.0.6/src/mspec_cli.egg-info}/PKG-INFO +1 -1
- {mspec_cli-4.0.5 → mspec_cli-4.0.6}/LICENSE +0 -0
- {mspec_cli-4.0.5 → mspec_cli-4.0.6}/MANIFEST.in +0 -0
- {mspec_cli-4.0.5 → mspec_cli-4.0.6}/README.md +0 -0
- {mspec_cli-4.0.5 → mspec_cli-4.0.6}/setup.cfg +0 -0
- {mspec_cli-4.0.5 → mspec_cli-4.0.6}/src/mspec/__init__.py +0 -0
- {mspec_cli-4.0.5 → mspec_cli-4.0.6}/src/mspec/__main__.py +0 -0
- {mspec_cli-4.0.5 → mspec_cli-4.0.6}/src/mspec/cli.py +0 -0
- {mspec_cli-4.0.5 → mspec_cli-4.0.6}/src/mspec/commands/__init__.py +0 -0
- {mspec_cli-4.0.5 → mspec_cli-4.0.6}/src/mspec/commands/doctor.py +0 -0
- {mspec_cli-4.0.5 → mspec_cli-4.0.6}/src/mspec/commands/update.py +0 -0
- {mspec_cli-4.0.5 → mspec_cli-4.0.6}/src/mspec/core/__init__.py +0 -0
- {mspec_cli-4.0.5 → mspec_cli-4.0.6}/src/mspec/core/config.py +0 -0
- {mspec_cli-4.0.5 → mspec_cli-4.0.6}/src/mspec/core/template.py +0 -0
- {mspec_cli-4.0.5 → mspec_cli-4.0.6}/src/mspec/templates/config.yaml +0 -0
- {mspec_cli-4.0.5 → mspec_cli-4.0.6}/src/mspec/templates/design-issue-taxonomy.md +0 -0
- {mspec_cli-4.0.5 → mspec_cli-4.0.6}/src/mspec/templates/design-issues.md +0 -0
- {mspec_cli-4.0.5 → mspec_cli-4.0.6}/src/mspec/templates/requirement-issue-taxonomy.md +0 -0
- {mspec_cli-4.0.5 → mspec_cli-4.0.6}/src/mspec/templates/requirement-issues.md +0 -0
- {mspec_cli-4.0.5 → mspec_cli-4.0.6}/src/mspec/utils/__init__.py +0 -0
- {mspec_cli-4.0.5 → mspec_cli-4.0.6}/src/mspec/utils/console.py +0 -0
- {mspec_cli-4.0.5 → mspec_cli-4.0.6}/src/mspec_cli.egg-info/SOURCES.txt +0 -0
- {mspec_cli-4.0.5 → mspec_cli-4.0.6}/src/mspec_cli.egg-info/dependency_links.txt +0 -0
- {mspec_cli-4.0.5 → mspec_cli-4.0.6}/src/mspec_cli.egg-info/entry_points.txt +0 -0
- {mspec_cli-4.0.5 → mspec_cli-4.0.6}/src/mspec_cli.egg-info/requires.txt +0 -0
- {mspec_cli-4.0.5 → mspec_cli-4.0.6}/src/mspec_cli.egg-info/top_level.txt +0 -0
- {mspec_cli-4.0.5 → mspec_cli-4.0.6}/tests/test_init.py +0 -0
|
@@ -163,18 +163,15 @@ def _run_openspec_init(target_path: Path) -> bool:
|
|
|
163
163
|
).ask()
|
|
164
164
|
return continue_anyway
|
|
165
165
|
|
|
166
|
-
# 2. 执行 openspec init
|
|
166
|
+
# 2. 执行 openspec init(交互模式,让用户可以看到界面并交互)
|
|
167
167
|
console.print("[dim]正在调用 openspec init...[/dim]")
|
|
168
168
|
try:
|
|
169
|
-
result = manager.run(["init"], cwd=target_path)
|
|
169
|
+
result = manager.run(["init"], cwd=target_path, interactive=True)
|
|
170
170
|
if result.returncode == 0:
|
|
171
171
|
console.print("[green]✓ openspec init 完成[/green]")
|
|
172
172
|
return True
|
|
173
173
|
else:
|
|
174
|
-
|
|
175
|
-
console.print(f"[yellow]⚠ openspec init 返回警告: {result.stderr}[/yellow]")
|
|
176
|
-
else:
|
|
177
|
-
console.print("[yellow]⚠ openspec init 返回非零退出码,继续执行...[/yellow]")
|
|
174
|
+
console.print("[yellow]⚠ openspec init 返回非零退出码,继续执行...[/yellow]")
|
|
178
175
|
return True # 仍视为成功,继续执行
|
|
179
176
|
except Exception as e:
|
|
180
177
|
console.print(f"[yellow]⚠ openspec init 执行异常: {e}[/yellow]")
|
|
@@ -109,12 +109,15 @@ class OpenspecManager:
|
|
|
109
109
|
|
|
110
110
|
return ["openspec"]
|
|
111
111
|
|
|
112
|
-
def run(
|
|
112
|
+
def run(
|
|
113
|
+
self, args: list, cwd: Optional[Path] = None, interactive: bool = False
|
|
114
|
+
) -> subprocess.CompletedProcess:
|
|
113
115
|
"""运行 openspec 命令
|
|
114
116
|
|
|
115
117
|
Args:
|
|
116
118
|
args: 命令参数
|
|
117
119
|
cwd: 工作目录
|
|
120
|
+
interactive: 是否为交互模式(True 时直接连接终端,False 时捕获输出)
|
|
118
121
|
|
|
119
122
|
Returns:
|
|
120
123
|
subprocess.CompletedProcess: 执行结果
|
|
@@ -131,12 +134,17 @@ class OpenspecManager:
|
|
|
131
134
|
else:
|
|
132
135
|
raise RuntimeError("openspec 不可用")
|
|
133
136
|
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
cwd=str(cwd) if cwd else None
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
137
|
+
if interactive:
|
|
138
|
+
# 交互模式:直接连接终端,不捕获输出
|
|
139
|
+
return subprocess.run(cmd, cwd=str(cwd) if cwd else None)
|
|
140
|
+
else:
|
|
141
|
+
# 非交互模式:捕获输出
|
|
142
|
+
return subprocess.run(
|
|
143
|
+
cmd,
|
|
144
|
+
cwd=str(cwd) if cwd else None,
|
|
145
|
+
capture_output=True,
|
|
146
|
+
text=True,
|
|
147
|
+
)
|
|
140
148
|
|
|
141
149
|
def install(self, global_install: bool = True) -> bool:
|
|
142
150
|
"""安装 openspec
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|