Runs a Plushie application that connects to an already-listening renderer via a Unix domain socket or TCP port.
Usage
mix plushie.connect MyApp # socket from env, token from env/stdin
mix plushie.connect MyApp /tmp/plushie.sock # explicit socket
mix plushie.connect MyApp :4567 # explicit TCP port
mix plushie.connect MyApp /path.sock --token TOKEN # explicit tokenHow it connects
The renderer (plushie --listen) creates a socket and either spawns
this task (via --exec) or prints connection info for manual use.
Launched by --listen --exec: The renderer sets PLUSHIE_SOCKET
and PLUSHIE_TOKEN in the environment and writes a JSON negotiation
line to stdin. The task reads the token from the environment first,
falling back to stdin if env vars weren't forwarded (e.g., over SSH).
Manual connect: The user copies the socket path and token from the renderer's output and provides them as CLI arguments.
Token resolution (in order)
--tokenCLI flagPLUSHIE_TOKENenvironment variable- JSON line from stdin (1 second timeout):
{"token":"...","protocol":1} - No token (connect without -- renderer decides if that's OK)
If the token is resolved from steps 1 or 2, stdin is not read.
Socket resolution (in order)
- Positional CLI argument after the module name
PLUSHIE_SOCKETenvironment variable- Error
Options
--token TOKEN-- shared token for authentication--json-- use JSON wire format instead of MessagePack--daemon-- keep running after all windows close