Skip to content

Commit aa8ded0

Browse files
authored
Update analyzer.py
1 parent f482e45 commit aa8ded0

1 file changed

Lines changed: 27 additions & 0 deletions

File tree

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
#!/usr/bin/env python3
2+
import click
3+
from mechanicalmind_ai.core import ErrorDiagnosisEngine
4+
import datetime
5+
6+
@click.command()
7+
@click.argument('error_log')
8+
def diagnose(error_log):
9+
"""CLI para diagnóstico de errores de dependencias"""
10+
try:
11+
engine = ErrorDiagnosisEngine()
12+
result = engine.full_diagnosis(error_log)
13+
14+
click.echo("\n=== Diagnóstico MechMind AI ===")
15+
click.echo(f"📌 Error: {error_log[:100]}...")
16+
click.echo(f"🔍 Tipo: {result['error_type']}")
17+
click.echo(f"🔄 Confianza: {result['confidence']*100:.1f}%")
18+
click.echo("\n💡 Soluciones recomendadas:")
19+
for i, sol in enumerate(result['solutions'], 1):
20+
click.echo(f" {i}. {sol}")
21+
click.echo(f"\n⏰ Timestamp: {result['timestamp']}")
22+
click.echo("="*40)
23+
except Exception as e:
24+
click.echo(f"❌ Error en el diagnóstico: {str(e)}", err=True)
25+
26+
if __name__ == '__main__':
27+
diagnose()

0 commit comments

Comments
 (0)