MCPcopy Index your code
hub / github.com/BasicProtein/AugmentCode-Free / kill_processes_command

Function kill_processes_command

augment_tools_core/cli.py:242–280  ·  view source on GitHub ↗

Kill IDE processes.

(ide, force)

Source from the content-addressed store, hash-verified

240@click.option('--ide', required=True, help='IDE type (vscode, cursor, windsurf, jetbrains)')
241@click.option('--force', is_flag=True, help='Force kill processes')
242def kill_processes_command(ide, force):
243 """Kill IDE processes."""
244 import asyncio
245 from .process_manager import ProcessManager
246
247 try:
248 ide_type = parse_ide_type(ide)
249 ide_name = get_ide_display_name(ide_type)
250
251 pm = ProcessManager()
252
253 # 检查进程
254 processes = pm.get_ide_processes(ide_type)
255 if not processes:
256 print_info(f"未找到 {ide_name} 进程")
257 return
258
259 print_warning(f"即将终止 {len(processes)} 个 {ide_name} 进程")
260 for proc in processes:
261 print_warning(f" {proc}")
262
263 if not force:
264 if not click.confirm("确定要终止这些进程吗?"):
265 print_info("操作已取消")
266 return
267
268 # 终止进程
269 async def kill_processes():
270 return await pm.kill_ide_processes(ide_type, force=True)
271
272 success = asyncio.run(kill_processes())
273
274 if success:
275 print_success("所有进程已成功终止")
276 else:
277 print_warning("部分进程可能无法终止")
278
279 except Exception as e:
280 print_error(f"终止进程失败: {e}")
281
282@main_cli.command("file-cleanup")
283@click.option('--ide', required=True, help='IDE type (vscode, cursor, windsurf, jetbrains)')

Callers

nothing calls this directly

Calls 10

get_ide_processesMethod · 0.95
parse_ide_typeFunction · 0.85
get_ide_display_nameFunction · 0.85
ProcessManagerClass · 0.85
print_infoFunction · 0.85
print_warningFunction · 0.85
kill_processesFunction · 0.85
print_successFunction · 0.85
print_errorFunction · 0.85
runMethod · 0.45

Tested by

no test coverage detected