feat: Add KI-Einstiegsscript for comprehensive project overview
- Introduced `ki_project_overview.py` for automated analysis of EspoCRM project structure, entities, relationships, custom PHP classes, workflows, frontend adjustments, and internationalization. - Created `ki-overview.sh` wrapper script for executing the Python script with various output options. - Updated `README.md` to include a quick start section for the new KI entry script. - Added detailed documentation in `KI_OVERVIEW_README.md` explaining the script's purpose, usage, and output format. - Summarized the new features and files in `KI_OVERVIEW_SUMMARY.md`. - Enhanced `.vscode/settings.json` to approve new scripts for execution.
This commit is contained in:
100
custom/scripts/ki-overview.sh
Executable file
100
custom/scripts/ki-overview.sh
Executable file
@@ -0,0 +1,100 @@
|
||||
#!/bin/bash
|
||||
#
|
||||
# KI-Einstiegsscript Wrapper
|
||||
# ==========================
|
||||
# Führt ki_project_overview.py aus und bietet verschiedene Ausgabeoptionen
|
||||
#
|
||||
|
||||
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
|
||||
PROJECT_ROOT="$(cd "$SCRIPT_DIR/../.." && pwd)"
|
||||
PYTHON_SCRIPT="$SCRIPT_DIR/ki_project_overview.py"
|
||||
|
||||
# Farben
|
||||
GREEN='\033[0;32m'
|
||||
BLUE='\033[0;34m'
|
||||
YELLOW='\033[1;33m'
|
||||
NC='\033[0m' # No Color
|
||||
|
||||
# Hilfe anzeigen
|
||||
show_help() {
|
||||
cat << EOF
|
||||
KI-Einstiegsscript für EspoCRM Projekt
|
||||
======================================
|
||||
|
||||
Verwendung: $0 [OPTION]
|
||||
|
||||
Optionen:
|
||||
(keine) Vollständige Ausgabe auf stdout
|
||||
-f, --file Ausgabe in Datei speichern (/tmp/ki-overview.txt)
|
||||
-s, --stats Nur Schnellübersicht anzeigen
|
||||
-e, --entities Nur Entitäten-Analyse
|
||||
-r, --relations Nur Beziehungsgraph
|
||||
-h, --help Diese Hilfe anzeigen
|
||||
|
||||
Beispiele:
|
||||
$0 # Vollständige Analyse
|
||||
$0 --file # In Datei speichern
|
||||
$0 --stats # Nur Statistiken
|
||||
|
||||
Das Script analysiert automatisch:
|
||||
✓ Custom Entitäten und Felder
|
||||
✓ Beziehungen zwischen Entitäten
|
||||
✓ Custom PHP Klassen
|
||||
✓ Workflows
|
||||
✓ Frontend-Anpassungen
|
||||
✓ Internationalisierung
|
||||
|
||||
Weitere Dokumentation: $SCRIPT_DIR/KI_OVERVIEW_README.md
|
||||
EOF
|
||||
}
|
||||
|
||||
# Prüfe ob Python-Script existiert
|
||||
if [ ! -f "$PYTHON_SCRIPT" ]; then
|
||||
echo -e "${YELLOW}Fehler:${NC} Python-Script nicht gefunden: $PYTHON_SCRIPT"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# Wechsle in Projektverzeichnis
|
||||
cd "$PROJECT_ROOT" || exit 1
|
||||
|
||||
# Optionen verarbeiten
|
||||
case "${1:-}" in
|
||||
-h|--help)
|
||||
show_help
|
||||
exit 0
|
||||
;;
|
||||
-f|--file)
|
||||
OUTPUT_FILE="${2:-/tmp/ki-overview.txt}"
|
||||
echo -e "${BLUE}Führe Projekt-Analyse durch...${NC}"
|
||||
python3 "$PYTHON_SCRIPT" > "$OUTPUT_FILE" 2>&1
|
||||
LINES=$(wc -l < "$OUTPUT_FILE")
|
||||
echo -e "${GREEN}✓ Analyse abgeschlossen${NC}"
|
||||
echo -e " Ausgabe gespeichert in: ${YELLOW}$OUTPUT_FILE${NC}"
|
||||
echo -e " Zeilen: $LINES"
|
||||
echo ""
|
||||
echo -e "Zum Anzeigen:"
|
||||
echo -e " less $OUTPUT_FILE"
|
||||
echo -e " cat $OUTPUT_FILE"
|
||||
;;
|
||||
-s|--stats)
|
||||
echo -e "${BLUE}Schnellübersicht...${NC}"
|
||||
python3 "$PYTHON_SCRIPT" 2>&1 | head -n 30
|
||||
;;
|
||||
-e|--entities)
|
||||
echo -e "${BLUE}Entitäten-Analyse...${NC}"
|
||||
python3 "$PYTHON_SCRIPT" 2>&1 | sed -n '/ENTITÄTEN ANALYSE/,/BEZIEHUNGSGRAPH/p' | head -n -3
|
||||
;;
|
||||
-r|--relations)
|
||||
echo -e "${BLUE}Beziehungsgraph...${NC}"
|
||||
python3 "$PYTHON_SCRIPT" 2>&1 | sed -n '/BEZIEHUNGSGRAPH/,/CUSTOM LAYOUTS/p' | head -n -3
|
||||
;;
|
||||
"")
|
||||
# Keine Option = vollständige Ausgabe
|
||||
python3 "$PYTHON_SCRIPT"
|
||||
;;
|
||||
*)
|
||||
echo -e "${YELLOW}Fehler:${NC} Unbekannte Option: $1"
|
||||
echo "Verwenden Sie '$0 --help' für weitere Informationen."
|
||||
exit 1
|
||||
;;
|
||||
esac
|
||||
Reference in New Issue
Block a user