MCPcopy Create free account
hub / github.com/BasicProtein/AugmentCode-Free / clean_enhanced_command

Function clean_enhanced_command

augment_tools_core/cli.py:163–214  ·  view source on GitHub ↗

Enhanced cleanup with multiple strategies.

(ide, mode, keyword, force, kill_processes, skip_process_check)

Source from the content-addressed store, hash-verified

161@click.option('--kill-processes', is_flag=True, help='Automatically kill IDE processes')
162@click.option('--skip-process-check', is_flag=True, help='Skip process check')
163def clean_enhanced_command(ide, mode, keyword, force, kill_processes, skip_process_check):
164 """Enhanced cleanup with multiple strategies."""
165 import asyncio
166 from .database_manager import clean_ide_comprehensive
167 from .common_utils import validate_cleanup_options, get_cleanup_mode_display_name
168
169 try:
170 ide_type = parse_ide_type(ide)
171 ide_name = get_ide_display_name(ide_type)
172
173 # 验证选项
174 valid, error_msg = validate_cleanup_options(mode, ide_type)
175 if not valid:
176 print_error(error_msg)
177 return
178
179 print_info(f"开始增强清理 {ide_name}")
180 print_info(f"清理模式: {get_cleanup_mode_display_name(mode)}")
181 print_info(f"搜索关键字: {keyword}")
182
183 if force:
184 print_info("强制删除模式已启用")
185 if kill_processes:
186 print_info("自动终止进程模式已启用")
187 if skip_process_check:
188 print_info("跳过进程检查")
189
190 # 执行清理
191 async def run_cleanup():
192 result = await clean_ide_comprehensive(
193 ide_type=ide_type,
194 mode=mode,
195 keyword=keyword,
196 force_delete=force,
197 kill_processes=kill_processes or not skip_process_check
198 )
199 return result
200
201 result = asyncio.run(run_cleanup())
202
203 # 显示结果
204 if result["success"]:
205 print_success("清理完成!")
206 print_info("清理结果:")
207 print_info(result["summary"])
208 else:
209 print_error("清理过程中发生错误")
210 for error in result.get("errors", []):
211 print_error(f" - {error}")
212
213 except Exception as e:
214 print_error(f"清理失败: {e}")
215
216@main_cli.command("check-processes")
217@click.option('--ide', required=True, help='IDE type (vscode, cursor, windsurf, jetbrains)')

Callers

nothing calls this directly

Calls 9

parse_ide_typeFunction · 0.85
get_ide_display_nameFunction · 0.85
validate_cleanup_optionsFunction · 0.85
print_errorFunction · 0.85
print_infoFunction · 0.85
run_cleanupFunction · 0.85
print_successFunction · 0.85
runMethod · 0.45

Tested by

no test coverage detected