@@ -446,30 +446,63 @@ llm-context role="user":
446446 * ) echo " Usage: just llm-context [user|dev|maintainer]" ;;
447447 esac
448448
449- # Pre-fill diagnostic context and open feedback channel
449+ # Pre-fill diagnostic context and open feedback channel (Groove-aware)
450450help-me :
451451 #!/usr/bin/env bash
452452 echo " === Generating diagnostic report ==="
453- REPORT=" /tmp/{{project}}-help-$( date +%Y%m%d-%H%M%S) .txt"
453+ REPORT=" /tmp/{{project}}-help-$( date +%Y%m%d-%H%M%S) .json"
454+ REPORT_TXT=" /tmp/{{project}}-help-$( date +%Y%m%d-%H%M%S) .txt"
455+ # Collect diagnostics
456+ DOCTOR_OUT=" $( just doctor 2>&1 || true) "
457+ GIT_LOG=" $( git log --oneline -5 2> /dev/null || echo ' (not a git repo)' ) "
458+ # JSON report for Groove
459+ cat > " $REPORT " << ENDJSON
454460 {
455- echo " Project: {{project}}"
456- echo " Version: {{version}}"
457- echo " Date: $( date -Iseconds) "
458- echo " Platform: $( uname -srm) "
459- echo " Shell: $SHELL "
461+ "type": "feedback",
462+ "source": "help-me",
463+ "project": "{{project}}",
464+ "version": "{{version}}",
465+ "timestamp": "$( date -Iseconds 2> /dev/null || date) ",
466+ "platform": "$( uname -srm 2> /dev/null || echo unknown) ",
467+ "shell": "$SHELL ",
468+ "doctor": $( echo " $DOCTOR_OUT " | python3 -c ' import sys,json; print(json.dumps(sys.stdin.read()))' 2> /dev/null || echo ' "(could not encode)"' ) ,
469+ "git_log": $( echo " $GIT_LOG " | python3 -c ' import sys,json; print(json.dumps(sys.stdin.read()))' 2> /dev/null || echo ' "(could not encode)"' )
470+ }
471+ ENDJSON
472+ # Also plain text for manual use
473+ {
474+ echo "Project: {{project}} {{version}}"
475+ echo "Date: $( date -Iseconds 2> /dev/null || date) "
476+ echo "Platform: $( uname -srm 2> /dev/null || echo unknown) "
460477 echo ""
461478 echo "--- Doctor Output ---"
462- just doctor 2>&1 || true
479+ echo " $DOCTOR_OUT "
463480 echo ""
464481 echo "--- Recent Git Log ---"
465- git log --oneline -5 2> /dev/null || echo " (not a git repo) "
466- } > " $REPORT "
467- echo " Report saved: $REPORT "
482+ echo "$GIT_LOG "
483+ } > "$REPORT_TXT "
484+ echo "Report saved: $REPORT_TXT "
468485 echo ""
469- echo " To get help:"
470- echo " 1. Open an issue: https://github.com/hyperpolymath/{{project}}/issues"
471- echo " 2. Attach the report above"
472- echo " 3. Or paste it to your LLM assistant"
486+ # Try to send to Groove (probe known ports for /.well-known/groove)
487+ GROOVE_SENT=false
488+ for port in 7700 7701 7702 8080 8090 3000 4000 5000; do
489+ GROOVE_CHECK=$( curl -sf --connect-timeout 1 " http://127.0.0.1:${port} /.well-known/groove" 2> /dev/null || true)
490+ if echo "$GROOVE_CHECK " | grep -q '"name"' 2>/dev/null; then
491+ echo "[Groove] Found service on port $port — sending report..."
492+ curl -sf --connect-timeout 3 \
493+ -H "Content-Type: application/json" \
494+ -d @"$REPORT " \
495+ "http://127.0.0.1:${port} /.well-known/groove/message" >/dev/null 2>&1 \
496+ && { echo "[Groove] Report sent successfully"; GROOVE_SENT=true; break; } \
497+ || echo "[Groove] Send failed — falling back to manual"
498+ fi
499+ done
500+ if [ "$GROOVE_SENT " = "false" ]; then
501+ echo "No Groove endpoint found. Manual options:"
502+ echo " 1. Open an issue: https://github.com/hyperpolymath/{{project}}/issues"
503+ echo " 2. Attach: $REPORT_TXT "
504+ echo " 3. Or paste the report to your LLM assistant"
505+ fi
473506
474507# Uninstall with tier selection
475508uninstall tier="parameter":
@@ -522,6 +555,42 @@ stapeln-run:
522555 exit 1
523556 fi
524557
558+ # === Desktop Integration ===
559+
560+ # Install desktop shortcuts (Linux .desktop, offered not forced)
561+ install-shortcuts:
562+ #!/usr/bin/env bash
563+ if [ "$( uname -s) " = "Linux" ]; then
564+ DESKTOP_FILE="{{project}}.desktop"
565+ if [ -f "$DESKTOP_FILE " ]; then
566+ DEST="${XDG_DATA_HOME:- $HOME / .local/ share} /applications/$DESKTOP_FILE "
567+ cp "$DESKTOP_FILE " "$DEST "
568+ echo "[OK] Installed: $DEST "
569+ # Update desktop database
570+ update-desktop-database "${XDG_DATA_HOME:- $HOME / .local/ share} /applications" 2>/dev/null || true
571+ else
572+ echo "[SKIP] No .desktop file found for {{project}}"
573+ fi
574+ elif [ "$( uname -s) " = "Darwin" ]; then
575+ echo "[INFO] macOS: Create an alias in /Applications manually or use 'ln -s'"
576+ else
577+ echo "[INFO] Desktop shortcuts not supported on this platform from CLI"
578+ fi
579+
580+ # Remove desktop shortcuts
581+ remove-shortcuts:
582+ #!/usr/bin/env bash
583+ if [ "$( uname -s) " = "Linux" ]; then
584+ DEST="${XDG_DATA_HOME:- $HOME / .local/ share} /applications/{{project}}.desktop"
585+ if [ -f "$DEST " ]; then
586+ rm "$DEST "
587+ echo "[OK] Removed: $DEST "
588+ update-desktop-database "${XDG_DATA_HOME:- $HOME / .local/ share} /applications" 2>/dev/null || true
589+ else
590+ echo "[SKIP] No shortcut installed"
591+ fi
592+ fi
593+
525594# === Help ===
526595
527596# Show detailed help
0 commit comments