Hubfly space CLI Quick Start
The hubfly CLI is the fastest way to deploy code, inspect projects, open private tunnels, stream logs, run shell commands, and automate Hubfly space from CI.
Deploy with your coding agent
Install The CLI
On Linux and macOS, install the latest release with the shell installer:
terminal
The installer downloads the right release archive from GitHub for your OS and CPU, then installs hubfly to /usr/local/bin or ~/.local/bin if the system path is not writable.
| Platform | Install Path | Notes |
|---|---|---|
| Linux | curl ... | bash | Supports amd64 and arm64. |
| macOS | curl ... | bash | Supports Intel and Apple Silicon. |
| Windows | Manual release download | Download the hubfly_windows_*.zip asset from GitHub releases and add it to PATH. |
| Source build | go build -o hubfly . | Use this when developing the CLI locally. |
PATH check
hubfly version is not found, add ~/.local/bin to your shell PATH and open a new terminal.First Deploy
Start from an app directory that has a Dockerfile or a framework the Hubfly space builder can detect. Then log in and deploy.
1. Log in
terminal
2. Deploy from the current folder
terminal
3. Use a non-interactive deploy when scripting
terminal
hubfly deploy creates or reuses hubfly.build.json, checks the latest hubfly-builder release unless you pin one, builds a local Docker image, uploads it to the target region, shows a diff, and waits for the deployment unless --detach is set.
Daily Commands
| Goal | Command |
|---|---|
| Check the signed-in user | hubfly whoami |
| Open the project/container terminal UI | hubfly projects |
| Deploy the current app | hubfly deploy |
| Deploy with a Dockerfile | hubfly deploy --dockerfile ./deploy/Dockerfile --yes |
| Follow container logs | hubfly logs web-app --follow |
| Run one command in a container | hubfly exec web-app -- printenv |
| Open a shell | hubfly ssh web-app |
| Forward a private database | hubfly tunnel postgres-db 5432 5432 |
| Check for a CLI update | hubfly update --check |
Use In CI
In CI, create a Dashboard personal access token and store it as a secret named HUBFLY_TOKEN. Use --yes so the deploy can run without prompts.
name: Deploy
on:
push:
branches: [main]
jobs:
deploy:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Install Hubfly space CLI
run: curl -fsSL https://raw.githubusercontent.com/hubfly-space/hubfly-cli/main/install.sh | bash
- name: Deploy
env:
HUBFLY_TOKEN: ${{ secrets.HUBFLY_TOKEN }}
run: hubfly deploy --project my-api --region eu-1 --yes --detachCommand Search
Filter every CLI command, flag, and example from one place.
hubfly loginauthAuthenticate CLI session interactively via browser or headless personal access token.
Flags & Options
--tokenPersonal access token string for headless / non-interactive CLI authentication$ hubfly login --token hf_0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdefhubfly logoutauthInvalidate local CLI auth session and clear stored tokens from ~/.hubfly/config.json.
$ hubfly logouthubfly whoamiauthDisplay currently authenticated account user name, email, and organization binding.
$ hubfly whoamihubfly projectstuiLaunch persistent Bubble Tea terminal UI to browse projects, containers, metrics, and tunnels.
Flags & Options
--orgFilter project workspace list by organization ID or slug$ hubfly projects --org org_prod_123hubfly deploydeployBuild working directory locally, upload image to regional builder, and update bound container.
Flags & Options
--project <id|name|new>Target existing project ID/name or create a new project--region <region>Target deployment region (required for non-interactive new project deploys)--yesSkip interactive confirmation prompts and diff confirmation--config <path>Custom path to hubfly.build.json or project workspace directory--detachReturn immediately after upload without waiting for container healthcheck--dockerfile <path>Force Dockerfile mode and override default Dockerfile location--builder-version <tag>Pin specific hubfly-builder release tag (e.g. v1.7.1)$ hubfly deploy --project edge-api --region eu-west-1 --yes --detachhubfly build initconfigInitialize or refresh local hubfly.build.json configuration file with project defaults.
Flags & Options
--forceOverwrite existing build configuration file with defaults--printPrint generated JSON structure directly to stdout$ hubfly build init --dockerfile ./deploy/Dockerfilehubfly build validateconfigVerify local build configuration file and inspect build source validity before deployment.
Flags & Options
--jsonOutput structured validation response in JSON format for CI$ hubfly build validate --jsonhubfly build explainconfigInspect what hubfly-builder auto-detects and explain generated Dockerfile/run steps.
Flags & Options
--jsonOutput detection report as JSON$ hubfly build explain --jsonhubfly stack planstackInspect local Compose file and preview changes, resources, ports, and volumes.
Flags & Options
--file <path>Custom Compose file path (defaults to docker-compose.yml)--jsonOutput machine-readable stack summary in JSON format$ hubfly stack plan --file docker-compose.prod.ymlhubfly stack upstackDeploy Compose stack services to Hubfly space cloud with dependency ordering and volume creation.
Flags & Options
--project <id|name|new>Target Hubfly space project for stack allocation--region <region>Target deployment region--yesSkip interactive prompts--remove-orphansRemove managed containers no longer present in Compose file--no-buildSkip local Docker builds for build-backed services$ hubfly stack up --project ecommerce-stack --region eu-west-1 --yeshubfly stack statusstackShow live runtime status for all services declared in local stack state.
$ hubfly stack statushubfly stack logsstackStream combined stdout and stderr logs for all or selected stack services.
Flags & Options
-f, --followContinuously tail live stack logs$ hubfly stack logs api db -fhubfly stack downstackTear down stack services in reverse dependency order.
Flags & Options
--volumesDelete associated stack persistent storage volumes$ hubfly stack down --volumes --yeshubfly tunneltunnelsEstablish encrypted Yamux WebSocket tunnel from localhost port to private container port.
$ hubfly tunnel postgres-db 5432 5432hubfly sshtunnelsOpen interactive PTY shell session or run non-interactive command inside container.
$ hubfly ssh api-server -- ls -la /app/datahubfly exectunnelsExecute single command with 55s timeout inside target container.
$ hubfly exec web-app -- printenvhubfly logstunnelsStream real-time container log output directly to local terminal.
Flags & Options
-f, --followKeep log connection open and stream new lines$ hubfly logs web-app -fhubfly serviceserviceRun CLI as background tunnel daemon with CORS-enabled REST API for desktop/IDE tools.
Flags & Options
--port <port>Custom HTTP port for daemon listener (default: 5600)$ hubfly service --port 5600hubfly updateserviceCheck for new hubfly-cli GitHub releases and automatically update local binary.
Flags & Options
--checkOnly check for available updates without downloading binary$ hubfly update --checkConfig And Storage
Local CLI state lives under ~/.hubfly. CI can skip local files by setting HUBFLY_TOKEN.
~/.hubfly/config.json: saved login token and profile data.~/.hubfly/tools: downloaded helper tools such ashubfly-builder.~/.hubfly/keys: generated key material for CLI connection flows.~/.hubfly/known_hosts: Hubfly space-managed SSH host keys.~/.hubfly/logs/debug.log: TUI debug output whenHUBFLY_DEBUG=1or--debugis used.
Token handling
HUBFLY_TOKEN and personal access tokens as secrets. Do not commit them to source control or paste them into build logs.