Hubfly spaceDocs
Console

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

$ hubfly service [--port <port>]
# Example: Launch daemon listener on port 5600:
$ hubfly service --port 5600
2026/07/26 10:00:00 Tunnel Service running on :5600
OptionTypeDefaultDescription
--port <port>Integer5600HTTP 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 version
Hubfly space CLI v1.7.1 (commit 8f3a1d9, built 2026-07-20, darwin/arm64)

hubfly update & Self-Updating

Checks GitHub releases for new CLI versions and automatically replaces the local binary:

terminal

# 1. Check for available release updates without downloading:
$ hubfly update --check
Checking for updates...
Latest release: v1.7.1 (current: v1.7.0)
# 2. Perform automated binary upgrade:
$ hubfly update
Downloading hubfly_darwin_arm64.tar.gz...
Verifying SHA-256 checksum...
Successfully updated hubfly to v1.7.1

Desktop Integration

Desktop tools (Electron apps, VSCode extensions) can execute hubfly service --port 5600 in the background to manage project tunnels without opening terminal windows.
Something unclear or out of date? Emailsupport@hubfly.spaceBack to top