Watch over things + stream your mac to remote server
Currently this daemon is WIP but I already use it for one thing, to watch over my Karabiner config.
Install task. Then run task setup & follow instructions until it says ✔️ you are setup.
Run task to see all possible commands.
-
Create
~/.config/ghost/ghost.toml(or pointGHOST_CONFIGat your preferred path) with watchers you care about. Example:[[watchers]] name = "karabiner" path = "/Users/nikiv/config/i/karabiner" match = "karabiner.edn" command = "/Users/nikiv/bin/goku" debounce_ms = 150 run_on_start = true
To keep long-running processes alive (for example dev servers or tunnels), add
[[servers]]entries. Ghost will launch each server on start, restart it if it exits, and capture all TTY input/output into a log file.[[servers]] name = "web" cwd = "/Users/nikiv/code/web-app" command = "npm run dev" restart = true # default restart_delay_ms = 500 # optional log_path = "~/logs/web.log" # optional; defaults to ~/.local/state/ghost/servers/<name>.log pty = true # default; makes the process believe it's in a terminal
Every server stream is mirrored to the daemon output and appended to the configured log (or the default under
~/.local/state/ghost/servers). Setpty = falsefor programs that should run without a pseudo-terminal.To stream your Mac to a remote server with OBS while avoiding sensitive apps, configure the
streamingtable. Ghost connects to obs-websocket, auto-starts streaming (optional) and swaps to a dedicated privacy scene whenever any excluded application is visible.[streaming] enabled = true obs_host = "127.0.0.1:4455" # obs-websocket host (scheme optional, ws:// by default) obs_password = "super-secret" # optional live_scene = "Desktop" privacy_scene = "Ghost Privacy" auto_start = true # start OBS streaming once connected exclude_applications = ["Telegram", "Spark", "1Password"] privacy_mode = "onscreen" # or "frontmost" if you only care about the active app poll_interval_ms = 250 # optional, defaults to 250ms
Requirements:
- OBS 28+ with obs-websocket enabled (Tools → WebSocket Server Settings). Point
obs_hostat that listener; usewss://...if you proxy TLS. - Create two OBS scenes (
live_scenefor normal streaming,privacy_scenefor the standby slate). Ghost simply flips between them; layout/design is up to you. - Grant
ghostscreen-recording + accessibility permissions in macOS so it can enumerate on-screen windows and detect excluded apps.
When any excluded application owns a visible window, Ghost switches to the privacy scene so the content never leaves your machine. As soon as those apps leave the screen, Ghost automatically reverts to the live scene and keeps the stream running to your remote destination.
- OBS 28+ with obs-websocket enabled (Tools → WebSocket Server Settings). Point
-
From the repo run
task runto start the Go daemon directly, ortask deployto install aghostbinary to~/bin. -
Save the config file you pointed at and ghost will hot-reload watchers automatically.
Any PR to improve is welcome. codex & cursor are nice for dev. Great working & useful patches are most appreciated (ideally). Issues with bugs or ideas are welcome too.