// cozygateway

the process beside your agent.

CozyGateway keeps sessions, attachments and approvals in SQLite. CozyAgents and Hermes connect out, so the runtime opens no listener.

install it in one line.

what the installer does
stepwhat happens
verifiesevery download against the release checksums (SHA-256)
addsNode 24, only if missing
asks, no Hermeswhich harness runs your bots: CozyAgents (Enter) or Hermes Agent, then which provider or local endpoint and which model new bots use
keepsan existing Hermes Agent, and opens its model picker
asksAllow CozyChat to access this Gateway over your local network? [y/N]; Enter keeps 127.0.0.1:8787
ends witha pairing QR and plain-text code in the same terminal
runs asmacOS launchd, Linux systemd --user (needs a login session and loginctl), Windows current-user Scheduled Task, no admin
againre-run to update in place; uninstall supported; containers use the Docker guide

macOS + Linux

terminal
curl -fsSL https://cozylabs.ai/setup | bash

pin a specific release

Installs v0.8.2 instead of the newest release, for reproducing a bug report.

terminal
curl -fsSL https://cozylabs.ai/setup | COZYGATEWAY_INSTALL_TAG=v0.8.2 bash

Windows PowerShell

powershell
irm https://cozylabs.ai/setup | iex

pin a specific release

Installs v0.8.2 instead of the newest release, for reproducing a bug report.

powershell
$env:COZYGATEWAY_INSTALL_TAG='v0.8.2'; irm https://cozylabs.ai/setup | iex

No Hermes on this computer? The installer offers CozyAgents.

Add another computer to an existing gateway:

macOS + Linux

terminal
curl -fsSL https://cozylabs.ai/agents.sh | bash

Windows PowerShell

powershell
irm https://cozylabs.ai/agents.ps1 | iex

External access stays yours to configure. Use the access guide for Tailscale, tunnels, and Docker.

pair this gateway.

the local-network question
answerresultuse when
ylistens on 0.0.0.0:8787; the QR carries a LAN addressprivate home Wi-Fi you control; never guest, public, office, school or shared; never forwarded on the router
Enter, n, no terminal attachedstays on 127.0.0.1:8787anywhere else; add Tailscale Serve for remote access and keep loopback

Reinstalls keep your answer. Change it later: cozygateway configure.

cozygateway configure

cozygateway pair

Prints a single-use QR and ten-minute code. Scan it, enter it with the address, or paste the block. Your phone keeps the token in Keychain; the gateway stores its hash.

getting connected

reliability you can
read the source for.

A dependable agent connection needs more than a socket that stays open. It needs durable records, clear ownership, and a plan for the moment that socket closes.

Implementation reviewed against CozyGateway v0.7.6. Each source link points to that release.

The transcript outlives the connection.

Committed messages live in SQLite with per-thread sequence numbers. On reconnect, a device supplies its last sequence for each thread. The gateway sends the later committed messages in order, then signals that synchronization is complete.

Your phone can catch up without asking a transient stream to be the permanent record. The client still needs a valid cursor and a successful connection.

Delivery has a memory.

The agent connection uses a durable SQLite inbox and outbox. Commands and events carry sequence identities and acknowledgement state. Losing the connection does not delete the queued command.

When an agent replays an event whose acknowledgement was lost, the gateway can acknowledge it without adding the same event to the conversation again. This protects delivery and transcript projection; it does not make arbitrary external actions execute exactly once.

Restarts have a recovery path.

On reconnect, the gateway and a compatible runtime reconcile sequence cursors and flush unacknowledged commands. The runner connection also uses receipts to distinguish completed operations from operations that still need delivery.

Recovery is deliberately narrower than restarting every action. Interrupted work can require attention, and incompatible protocol versions are rejected. A restart test checks that a committed agent event is projected once across gateway reassembly.

Hermes support is verified, not assumed.

A small plugin connects out from Hermes Agent to CozyGateway. For session administration, the gateway probes known Hermes API routes and response shapes before advertising support. Exact session detail and limited compatibility have different capability versions.

An older or unreachable Hermes API does not acquire a working-looking control just because the app knows how to draw one. If a session mutation times out, the gateway reports an ambiguous outcome and asks for a refresh instead of blindly retrying it.

Your device has an identity.

Pairing uses a single-use code that expires. Your phone stores its device token in the Keychain; the gateway stores the token’s hash. Device credentials can be revoked, including closing that device’s live socket.

Notification content uses AES-256-GCM encryption before it reaches the push relay. The relay still handles routing metadata. Your gateway and chosen model provider are part of the message-processing boundary; this is not a claim of zero-knowledge chat.

Know what is on your machine.

The website installer pins a named release and checks the downloaded files against SHA-256 values. Services use the platform’s lifecycle: launchd on macOS, a systemd user service on Linux, and a current-user Scheduled Task on Windows, with Docker documented separately.

Keep your host available, retain your gateway data, and maintain backups. A durable local database is not a backup, and operating-system sleep, network availability, and model-provider failures still affect the work.

plaintext on your box.

The gateway reads messages to drive your agent and keeps them in SQLite on your computer. Push notifications leave encrypted; the relay receives an opaque id and ciphertext.

CozyAgents or Hermes Agent.

read the docs