Windows Daemon Mode
qp daemon keeps a long-lived background process on Windows so that every invocation connects to it via named pipe instead of cold-starting a new process.
On antivirus-heavy Windows machines this reduces per-invocation latency from ~1 000 ms to ~2 ms.
Setup
qp setup --windowsThis does three things:
- Starts the daemon process.
- Installs a PowerShell shim (
qpfunction) in your PowerShell profile that routes commands through the daemon’s named pipe. - Registers a Task Scheduler entry (
qp-daemon-autostart) so the daemon starts automatically at login.
On non-Windows platforms qp setup is a no-op.
Control
qp daemon start # start the background process
qp daemon stop # stop it by PID
qp daemon status # show running state, PID, uptime, log path
qp daemon restart # stop then startdaemon status output includes the log file path (~/.qp/daemon/daemon.log) for troubleshooting.
How It Works
The daemon listens on the named pipe \\.\pipe\qp-daemon. When you run any qp command the PowerShell shim:
- Connects to the pipe (1-second timeout).
- Sends a JSON request containing the arguments and working directory.
- Streams back stdout/stderr events until a
doneevent arrives.
Commands that manage the daemon itself (daemon, setup, __daemon) bypass the proxy automatically. The daemon also sets QP_DAEMON_BYPASS=1 on child processes to prevent recursion.
Metadata and Logs
| Path | Purpose |
|---|---|
~/.qp/daemon/daemon.json |
PID and start timestamp |
~/.qp/daemon/daemon.log |
Daemon stdout/stderr |
Nudge
If you are on Windows and have not run qp setup --windows, qp will periodically suggest it (at most once every 24 hours). Running setup silences the nudge.
Limitations
- Daemon IPC is Windows-only. On macOS and Linux cold-start latency is already low enough that a daemon is unnecessary.
- The PowerShell shim is installed into
~/Documents/PowerShell/Microsoft.PowerShell_profile.ps1. Other shells are not shimmed automatically.