#!/bin/bash # Check status of Jarvis daemon and session PID_FILE="$HOME/.local/state/jarvis/jarvis.pid" LOG_FILE="$HOME/.local/state/jarvis/jarvis.log" echo "=== Jarvis Voice Assistant Status ===" echo "" # Check daemon status echo "Daemon:" if [ -f "$PID_FILE" ]; then PID=$(cat "$PID_FILE") if kill -0 "$PID" 2>/dev/null; then echo " Status: Running (PID: $PID)" # Get process info ps -p "$PID" -o %cpu,%mem,etime | tail -1 | while read cpu mem time; do echo " CPU: $cpu% Memory: $mem% Uptime: $time" done else echo " Status: Not running (stale PID file)" fi else echo " Status: Not running" fi # Check tmux session echo "" echo "Claude Session (tmux):" if tmux has-session -t jarvis 2>/dev/null; then echo " Status: Active" echo " Attach: tmux attach -t jarvis" # Show last few lines of session echo "" echo " Last output:" tmux capture-pane -t jarvis -p -S -5 | sed 's/^/ /' else echo " Status: No active session" fi # Check audio devices echo "" echo "Audio:" if command -v python3 &>/dev/null; then python3 -c " import sounddevice as sd try: default_input = sd.query_devices(kind='input') print(f\" Input device: {default_input['name']}\") except Exception as e: print(f\" Input device: Error - {e}\") " 2>/dev/null || echo " Input device: Unable to query" fi # Show recent log entries if [ -f "$LOG_FILE" ]; then echo "" echo "Recent log entries:" tail -5 "$LOG_FILE" | sed 's/^/ /' fi echo "" echo "Commands:" echo " jarvis-start Start daemon" echo " jarvis-start --no-wake-word Start without wake word (immediate listen)" echo " jarvis-stop Stop daemon (keep tmux session)" echo " jarvis-stop --kill-session Stop daemon and kill session" echo " tmux attach -t jarvis View Claude session"