Service Mode & Self-Updates
The Hubfly space CLI can operate as a persistent background daemon via hubfly service. This allows desktop applications, browser extensions, or local automation tools to manage tunnels programmatically over HTTP.
Daemon Service Mode Overview
In service mode, the CLI starts an HTTP server with CORS enabled. Local clients can dispatch JSON POST requests to start and stop encrypted Yamux WebSocket tunnels without spawning interactive TUI processes.
hubfly service Command & Options
terminal
| Option | Type | Default | Description |
|---|---|---|---|
--port <port> | Integer | 5600 | HTTP port number for the local daemon REST listener. |
Service REST API Endpoints
The daemon exposes four CORS-enabled HTTP endpoints:
1. GET /health
Healthcheck endpoint for local monitoring. Returns 200 OK with body "OK".
2. POST /start
Initializes a new background tunnel session:
POST http://localhost:5600/start
Content-Type: application/json
{
"id": "tunnel-dev-db",
"connect_url": "wss://api.hubfly.space/tunnel",
"connect_token": "token_abc123",
"local_port": 5432,
"target_port": 5432,
"targets": [
{
"target_id": "tgt_1",
"container_id": "cont_987",
"container_name": "postgres-db",
"target_port": 5432,
"local_port": 5432
}
]
}3. POST /stop
Stops an active tunnel session by ID:
POST http://localhost:5600/stop
Content-Type: application/json
{
"id": "tunnel-dev-db"
}4. GET /status
Returns JSON array of all active and historical daemon tunnels:
GET http://localhost:5600/status
Response 200 OK:
[
{
"id": "tunnel-dev-db",
"local_port": 5432,
"target": "postgres-db:5432",
"gateway": "wss://api.hubfly.space/tunnel",
"status": "active",
"active_streams": 2,
"streams_opened": 15,
"bytes_sent": 142050,
"bytes_received": 984010,
"started_at": "2026-07-26T10:00:00Z",
"error": ""
}
]hubfly version
Displays CLI build metadata including version tag, git commit hash, build timestamp, and OS/arch binary details:
terminal
hubfly update & Self-Updating
Checks GitHub releases for new CLI versions and automatically replaces the local binary:
terminal
Desktop Integration
hubfly service --port 5600 in the background to manage project tunnels without opening terminal windows.