manage-apps/run
Claude Code 46b5ca7724 refactor(commands): ♻️ Implement modular CLI command system with decoupled entry points and shared utilities
Co-Authored-By: Lilith Autocommit <noreply@atlilith.com>
2026-03-20 05:38:43 -07:00

48 lines
1 KiB
Bash
Executable file

#!/usr/bin/env bash
set -euo pipefail
APP_DIR="$(cd "$(dirname "$0")/linux-bluefin" && pwd)"
ELECTRON="$APP_DIR/node_modules/.bin/electron"
LOG="/tmp/linux-bluefin.log"
cmd="${1:-}"
case "$cmd" in
gui)
echo "Stopping linux-bluefin..."
pkill -f "electron.*linux-bluefin" 2>/dev/null || true
sleep 0.3
echo "Starting linux-bluefin..."
DISPLAY=:1 nohup "$ELECTRON" "$APP_DIR" > "$LOG" 2>&1 &
echo "PID $! — logs: $LOG"
;;
gui:build)
echo "Building linux-bluefin..."
cd "$APP_DIR" && pnpm build
;;
gui:restart)
"$0" gui:build
"$0" gui
;;
gui:stop)
pkill -f "electron.*linux-bluefin" 2>/dev/null && echo "Stopped" || echo "Not running"
;;
gui:logs)
tail -f "$LOG"
;;
*)
echo "Usage: ./run <command>"
echo ""
echo "Commands:"
echo " gui Restart the linux-bluefin GUI"
echo " gui:build Build linux-bluefin"
echo " gui:restart Build then restart"
echo " gui:stop Stop linux-bluefin"
echo " gui:logs Tail logs"
;;
esac