How fathah/hermes-desktop works
Purpose and Entry Points
Hermes One is a native Electron desktop client that installs, configures, and operates the upstream Hermes Agent. It supports local Hermes (~/.hermes, API typically on 127.0.0.1:8642) or a remote Hermes API, exposing chat, profiles, sessions, providers, tools, schedules, messaging gateways, memory, and a 3D Office UI.
• Electron main bootstrap: src/main/index.ts, src/main/app/start.ts
• React renderer bootstrap and root routing/UI: src/renderer/src/main.tsx, src/renderer/src/App.tsx
• Build/runtime wiring: electron.vite.config.ts, electron-builder.yml
Electron Process Boundary
The app is split into a privileged Node/Electron main process and an unprivileged React renderer. The preload layer defines the renderer-accessible API; IPC registration centralizes calls from UI to filesystem, process spawning, local/remote API access, and persisted Hermes state.
• Main IPC registration: src/main/ipc/register.ts
• Preload bridge: src/preload/index.ts, src/preload/index.d.ts
• Security and privileged operations: src/main/security.ts, src/main/askpass.ts
Setup, Installation, and Runtime Targeting
First-run control flow selects local versus remote operation. Local mode detects or installs Hermes through the official installer, writes Hermes configuration, and starts/manages local processes. Remote mode validates a configured URL/API key and bypasses local installation. SSH/Docker support provides another execution-location boundary.
• Installer and provisioning: src/main/installer.ts, src/main/hermesone-provision.ts
• Local/remote routing and API client: src/main/remote-api.ts, src/main/api-url.ts
• SSH/Docker transport: src/main/ssh-remote.ts, src/main/ssh-docker.ts
Agent Configuration, Profiles, and Secrets
Hermes configuration is managed as files and state under ~/.hermes, with isolated named profiles. Provider/model configuration is mediated by registries and stores. Secrets resolve in priority order from process environment, .env, then an optional command-backed secret provider; command execution is deliberately confined to the main process.
• Config/profile lifecycle: src/main/config.ts, src/main/profiles.ts
• Provider and model management: src/main/providers.ts, src/main/models.ts, src/main/provider-registry.ts
• Secret-provider boundary: src/main/secrets/index.ts, src/main/secrets/commandProvider.ts
Chat and Streaming Data Flow
Chat UI submits messages, attachments, model choices, and slash-command effects through IPC or the dashboard transport. The main process calls the Hermes local/remote API and parses streamed SSE output. Stream events are converted into transcript updates, live tool/reasoning status, approvals, and token usage; sessions are persisted and can be resumed.
• Main stream orchestration: src/main/run-stream.ts, src/main/sse-parser.ts
• Chat screen and IPC state: src/renderer/src/screens/Chat/Chat.tsx, src/renderer/src/screens/Chat/hooks/useChatIPC.ts
• Shared stream contracts: src/shared/chat-stream.ts, src/shared/chat-approval.ts
Persistent Agent Workspace Features
The main process manages Hermes-backed session history, SQLite-related state access, memory, skills, tool configuration, cron jobs, and messaging platforms. Renderer screens are primarily views/controllers over those APIs rather than independent backends.
• Sessions and database access: src/main/sessions.ts, src/main/db.ts
• Agent capabilities: src/main/memory.ts, src/main/skills.ts, src/main/tools.ts
• Scheduled and messaging execution configuration: src/main/cronjobs.ts, src/main/messaging-platforms.ts
Remote Dashboard and Gateway Integration
A dashboard subsystem can launch or connect to a web/dashboard endpoint and relay WebSocket traffic, including chat transport adaptation. Messaging gateways are configured through Hermes and can require propagated environment/secrets. These are external-service boundaries alongside LLM providers and tool integrations.
• Dashboard launch/relay: src/main/dashboard-launch.ts, src/main/dashboard-websocket-relay.ts
• Renderer dashboard transport: src/renderer/src/screens/Chat/hooks/useDashboardChatTransport.ts
• Gateway UI: src/renderer/src/screens/Gateway/Gateway.tsx
Specialized Visual and Distribution Systems
The Office feature is a separate React/3D subsystem with scene, routing, presence, and interaction models, fed by Hermes/Office status rather than replacing core chat. Releases package Electron for desktop platforms, with auto-update support where packaging permits.
• Office startup/backend coordination: src/main/office-start.ts, src/main/claw3d.ts
• 3D scene and interaction domain: src/renderer/src/screens/Office/office3d/Office3D.tsx, src/renderer/src/screens/Office/office3d/interactions/registry.ts
• Packaging/updating: src/main/app/updater.ts, build/afterPack.js
Main entry points: register.ts IPC registry · remote-api.ts Runtime API router · App.tsx App routing · installer.ts Provisioning
Components 20
Renderer UI
Unprivileged React application.
- App routing
src/renderer/src/App.tsx - Chat UI · Submits chat state and renders streamed transcript updates.
src/renderer/src/screens/Chat/Chat.tsx - Dashboard transport
src/renderer/src/screens/Chat/hooks/useDashboardChatTransport.ts - Gateway UI
src/renderer/src/screens/Gateway/Gateway.tsx - Office 3D · Separate visual presence and interaction subsystem.
src/renderer/src/screens/Office/office3d/Office3D.tsx
Electron Main
Privileged desktop orchestration.
- Preload bridge · Exposes the approved main-process API to the renderer.
src/preload/index.ts - Main bootstrap
src/main/index.ts - IPC registry · Centralizes UI access to files, processes, state, and Hermes APIs.
src/main/ipc/register.ts - Provisioning · Selects local or remote mode and installs/configures local Hermes.
src/main/installer.ts - Runtime API router · Routes Hermes API calls to the configured target.
src/main/remote-api.ts - Chat stream orchestrator · Converts Hermes stream events into transcript, tool, approval, and usage updates.
src/main/run-stream.ts - Dashboard relay
src/main/dashboard-websocket-relay.ts - Office backend
src/main/office-start.ts
Hermes Runtime
Local, remote, and hosted agent targets.
- Hermes Agent API · Local API, configured remote API, or dashboard-connected Hermes endpoint.
- SSH/Docker transport · Alternative boundary for running against Hermes elsewhere.
src/main/ssh-remote.ts
Agent Workspace
Persistent Hermes configuration and state.
- ~/.hermes state · Profiles, configuration, sessions, and agent-managed state.
src/main/config.ts - Providers and secrets · Resolves provider/model settings and main-process secret sources.
src/main/providers.ts - Agent feature config · Memory, skills, tools, schedules, and messaging gateway configuration.
src/main/tools.ts
Distribution
Desktop packaging and updates.
- Desktop packaging
electron-builder.yml - Auto updater
src/main/app/updater.ts
Connections 23
- App routing → Chat UI: renders
- App routing → Gateway UI: renders
- App routing → Office 3D: renders
- Chat UI → Preload bridge: IPC requests/events
- Preload bridge → IPC registry: approved API
- Main bootstrap → IPC registry: registers
- Main bootstrap → Provisioning: starts setup
- Provisioning → Runtime API router: sets runtime mode
- Provisioning → ~/.hermes state: writes local config
- IPC registry → Chat stream orchestrator: chat operations
- Chat stream orchestrator → Runtime API router: stream API calls
- Runtime API router → Hermes Agent API: HTTP API
- Runtime API router → SSH/Docker transport: remote execution
- IPC registry → ~/.hermes state: profiles, sessions, state
- IPC registry → Providers and secrets: provider configuration
- Providers and secrets → Hermes Agent API: credentials and models
- IPC registry → Agent feature config: configure capabilities
- Agent feature config → Hermes Agent API: agent configuration
- Dashboard transport → Dashboard relay: WebSocket traffic
- Dashboard relay → Hermes Agent API: dashboard relay
- Office 3D → Office backend: Office status
- Office backend → Hermes Agent API: coordinates status
- Desktop packaging → Auto updater: ships updater