HappierDocs
Apps and interface

Daemon

Run Happier in the background (sessions, remote control, headless servers).

What is the daemon?

The Happier daemon is a small background process that keeps Happier “available” on your machine.

In practice, it’s what enables Happier to start and manage sessions even when you don’t have a terminal open. This is especially important for features like remote start (e.g. from the app/web UI): the daemon is the thing on your computer that can receive that request and launch the session locally.

It also helps the CLI:

  • keep long-running sessions alive
  • reconnect to and manage existing sessions
  • support remote control / orchestration features without requiring your terminal to stay open

Embedded terminal support

The in-app embedded terminal also depends on the daemon.

That is what allows Happier to:

  • create the terminal session on your machine,
  • reconnect to that same terminal after refresh/navigation,
  • stream output back into the app UI,
  • resize and restart the terminal from the app.

If the daemon is not running or the machine is unreachable, the embedded terminal cannot work.

Full guide: Embedded terminal.

Provider authentication support

Provider login flows in provider settings also depend on the daemon because Happier runs the real provider CLI on the target machine.

That is what allows Happier to:

  • launch provider login commands on the selected machine
  • stream the provider’s terminal output back into the app
  • detect URLs printed during login flows
  • refresh machine-local auth state after the login flow exits

Full guide: Provider authentication.

Local memory search support

Local memory search also depends on the daemon.

That is what allows Happier to:

  • build the machine-local memory index
  • maintain light or deep transcript indexing in the background
  • run optional local embeddings models on the machine
  • query the local index from the app/web UI

Because the index is daemon-local, memory search is scoped to the specific machine where the daemon runs.

Full guide: Local memory search.

When does it run?

You can run it in two ways:

  • On-demand: start it when you need it (some CLI commands may start it automatically).
  • Always-on (recommended): install it as a user service so it starts automatically after login and keeps running in the background.

Why always-on is recommended:

  • It makes your machine ready to start sessions remotely at any time.
  • It avoids “why can’t I start a session?” situations where the daemon simply isn’t running yet.
  • It’s the smoothest experience on headless servers (or laptops you want to control remotely).

Common commands

happier daemon status
happier daemon start
happier daemon stop
happier daemon list
happier daemon logs

Release lanes

The daemon follows the CLI/runtime lane you installed on that machine:

  • stable CLI install -> stable daemon/runtime
  • preview CLI install -> preview daemon/runtime
  • dev CLI install -> dev daemon/runtime

That means the public lane commands are:

happier daemon install
hprev daemon install
hdev daemon install

Likewise, updater commands stay lane-specific:

happier self update
hprev self update
hdev self update

There is no separate public daemon installer endpoint today; the daemon rides with the matching CLI lane on that machine.

After a successful self update, a daemon that lane's background service is running is restarted so it runs the new version. A daemon you started yourself (happier daemon start) and another lane's service are left running; restart those yourself when you are ready.

Restarting the daemon keeps your sessions running, and each session runner stays on the CLI version it started with. To move them onto the new version yourself, run happier daemon restart-session-runners (add --dry-run to preview).

Restarting a runner stops the agent's process, including any background agents or shells it is running. The command skips runners that are mid-turn or that the server reports as running background work, and reports them as busy; run it again once that work has finished. Restarting a runner from the app asks you first when background work is running, including while a foreground turn is also shown, and only restarts it once you confirm. The app also asks when its last activity report is old but still says work is running.

In development builds, you can opt in to automatic runner restarts:

hdev daemon restart-session-runners --on-update on

With this on, every time the daemon starts (after self update, an update started from the app, or a service restart after a manual install) it restarts the daemon-started session runners that are still on an older CLI. The sessions retain their identity and history. Runners already on the current version are not touched, and runners that are mid-turn or running background work are skipped, as are runners whose background activity the daemon cannot read from the server; restart them later with hdev daemon restart-session-runners. The setting is off by default, is read when the daemon starts, and is turned off again with --on-update off.

In development source, runner restart commands and previews also honor an active turn restored from the runner's persisted session marker after daemon restart. This protection applies even with --force-current-cli, which selects the CLI version rather than overriding turn safety. A matching turn completion releases the protection.

Turn checks still depend on the daemon's observed state and persisted marker. A turn that starts while the daemon is down, or whose turn notification fails, can be missed. Leave automatic runner restarts off if you need to avoid that unattended interruption risk.

Side-by-side installs (stable vs preview vs dev)

You can install all three public lanes side-by-side (happier, hprev, hdev) without them overwriting each other.

The unsuffixed happier command belongs to the lane you installed first, or the one you last picked with the installer's --channel. Installing or updating another lane — including a desktop app of another lane — adds only that lane's own command (hprev, hdev) and never changes what happier runs. The desktop app of another lane uses your default lane's CLI and its background service instead of installing a second one.

Daemon runtime state is lane-scoped, and daemon services (LaunchAgent/systemd/Scheduled Task) use lane-scoped service identifiers. To inspect the exact service name/label/unit on your platform, run:

happier daemon service paths
hprev daemon service paths
hdev daemon service paths

Recommendation: keep only one lane’s daemon service enabled for a given server profile unless you have a specific reason to run multiple daemons concurrently.

Always-on: install as a user service

Install for your current default server profile:

happier daemon install

Advanced lifecycle control (and dry-run planning):

happier daemon service status
happier daemon service install --dry-run
happier daemon service restart

Platform notes:

  • macOS: LaunchAgent
  • Linux: systemd --user, with systemctl available and a working systemd user session. Linux systems without systemd cannot use this automatic startup path.
  • Windows: Scheduled Task (user-level)

Installed, but not started at login

If you would rather have the daemon run only while you are using Happier (for example only while the desktop app is open), install the service without its login trigger:

happier service install --no-autostart

The service stays installed and happier service start / stop / restart keep working — nothing starts it for you at login. On macOS the LaunchAgent is written with RunAtLoad off, on Linux the systemd --user unit is installed but not enabled, and on Windows the Scheduled Task is registered with a start date that has already passed instead of a logon trigger — so it is startable but never due, and Task Scheduler is told not to catch up a missed start.

On macOS an on-demand LaunchAgent also carries no keep-alive, so launchd does not relaunch the daemon if it crashes — start it again yourself, or from the desktop app. On Linux, switching only the mode changes the login trigger and leaves a running daemon alone; on macOS and Windows the job has to be re-registered to apply the new trigger, which restarts the daemon.

Switch back with:

happier service install --autostart at-login

Re-running install without either flag keeps whichever mode the service already has, so repairs and upgrades never turn the login trigger back on behind your back. happier service install --dry-run --json reports the mode it would apply as autostart.

To remove it:

happier daemon uninstall

On Windows, happier daemon service paths prints the Scheduled Task name and wrapper path.

Headless authentication (no TTY)

On headless servers (or anywhere you don’t have an interactive TTY), use:

happier auth login --no-open --method web

This prints an authorization URL and waits until you approve it in your browser (the request can expire; if it does, rerun the command).

If you have SSH access and want a fully automated experience (request + approval + credential write), run this from a machine where you're already authenticated:

happier auth pair-remote --ssh user@host --json

This is especially useful for provisioning headless servers because you can approve the connection from your already-signed-in machine and avoid copy/pasting URLs.

Troubleshooting

  • Check status: happier daemon status
  • Find logs: happier daemon logs
  • Service paths: happier daemon service paths

Linux without systemctl

If systemctl is unavailable, automatic startup cannot be installed. After signing in, check happier daemon status. If no daemon is running for the selected relay, start one manually:

happier daemon start

This starts the daemon for the current machine session; it does not arrange startup after login or reboot. Missing systemctl in your shell does not prove systemd is stopped. Manual recovery does not disable an existing service: if its automatic startup resumes later, that service can take over a conflicting manually started daemon under the existing ownership rules.

The development CLI checks for missing service commands before installation or doctor repair changes service definitions. It also lets manual startup proceed past readable leftover systemd units when systemctl is absent. Running daemon ownership and unreadable service state still protect against conflicting starts. This correction is not yet established as available in a published stable or preview release.

On this page