You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
feat(cli): enable daemon in binary via self-spawning
**Problem**: Daemon was disabled in binary builds because the separate
daemon script wasn't available in the compiled executable.
**Solution**: Binary now spawns itself in daemon mode using a special
--internal-daemon flag. This provides full terminal color polling in
both dev and binary modes with no external dependencies.
**Architecture**:
- Created entry.tsx as new entry point that routes based on flag
- Binary checks for --internal-daemon flag at startup
- If present: runs daemon logic (OSC polling + socket server)
- If absent: loads main CLI app (index.tsx)
- Theme system spawns binary itself instead of looking for script file
**Benefits**:
✅ Full theme detection in binary mode (terminal + IDE + OS)
✅ No external dependencies or file extraction needed
✅ Same codebase for dev and binary modes
✅ Clean process management with health checks
**Changes**:
- src/entry.tsx: New entry point with flag routing
- src/utils/terminal-theme-daemon-runner.ts: Wrapper for daemon main
- src/utils/terminal-theme-daemon.ts: Export runDaemonMain(), conditional auto-run
- src/utils/theme-system.ts: Self-spawn logic for binary mode
- scripts/build-binary.ts: Use entry.tsx as compilation entry point
**Testing**:
✅ Binary compiles successfully (78MB)
✅ Main process spawns daemon child process
✅ Socket communication works
✅ Clean cleanup on exit
✅ All 20 unit tests pass
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <[email protected]>
0 commit comments