Treeship
CLI reference

hub

Named workspace connections for pushing, pulling, and sharing artifacts on Hub.

A hub connection is a named link between your local Treeship and a workspace on Hub. You push receipts to it. Other people verify them there. Think of hub connections like tmux sessions -- named connections you can attach, detach, and kill independently.

Most developers need exactly one hub connection. Multiple hub connections exist when receipts need to go to separate workspaces (personal vs work, your company vs a client).

Commands

CommandDescription
treeship hub attachConnect to Hub (creates new or reconnects)
treeship hub detachDisconnect active hub connection (keeps keys)
treeship hub lsList all known hub connections
treeship hub statusShow active hub connection details
treeship hub use <name>Switch active hub connection
treeship hub push <id>Push artifact to active hub connection
treeship hub pull <id>Pull artifact from Hub
treeship hub openOpen workspace in browser
treeship hub kill <name>Remove a hub connection

treeship hub attach

Connects to Hub. If the hub connection name already exists locally with keys, reconnects without re-authenticating. If new, runs the device flow.

treeship hub attach
  visit treeship.dev/hub/activate
  code: 4b0a-6d36

attached
  name:      default
  hub id:    hub_661e5463912d
  endpoint:  api.treeship.dev
  workspace: treeship.dev/workspace/hub_661e5463912d
treeship hub attach --name acme-corp

Creates a hub connection named "acme-corp" pointing at a separate workspace.

treeship hub attach --name acme-corp

If "acme-corp" already exists with keys, reconnects instantly without the browser flow.

reconnected
  hub:      acme-corp
  hub id:   hub_f7e6d5c4b3a2
OptionDescription
--name <name>Hub connection name (default: "default")
--endpoint <url>Hub API endpoint (default: https://api.treeship.dev)

DPoP Security

All Hub requests use RFC 9449 DPoP proof-of-possession. Every request carries a DPoP JWT signed by the hub key. Stolen credentials are useless without the private key.

treeship hub detach

Disconnects the active hub connection. Keys are preserved locally so you can reconnect later.

treeship hub detach
detached from acme-corp
  keys preserved
  reconnect: treeship hub use acme-corp

treeship hub ls

Lists all known hub connections.

treeship hub ls
NAME             HUB ID                   ENDPOINT                         STATUS
--------------------------------------------------------------------------------
default          hub_661e5463912d         api.treeship.dev                 active
work             hub_a2b3c4d5e6f7         api.treeship.dev
acme-corp        hub_f7e6d5c4b3a2         api.treeship.dev

treeship hub status

Shows the currently active hub connection with details.

treeship hub status
hub:       default
hub id:    hub_661e5463912d
key:       key_9f8e7d6c (ed25519)
endpoint:  api.treeship.dev
workspace: treeship.dev/workspace/hub_661e5463912d

treeship hub use

Switches the active hub connection without re-authenticating. Accepts name or hub ID.

treeship hub use work
treeship hub use hub_a2b3c4d5e6f7

treeship hub push

Push an artifact to Hub. Returns a shareable verify URL.

treeship hub push art_f7e6d5c4
treeship hub push last
treeship hub push art_f7e6d5c4 --hub acme-corp
treeship hub push last --hub work
treeship hub push art_f7e6d5c4 --all

Pushes to every known hub connection. The verify URL is the same across all hub connections -- artifacts are content-addressed.

OptionDescription
--hub <name|id>Push to a specific hub connection
--allPush to all known hub connections

treeship hub pull

Pull an artifact from Hub into local storage. No authentication required.

treeship hub pull art_f7e6d5c4
treeship hub pull art_f7e6d5c4 --hub acme-corp

treeship hub open

Opens the active workspace in the browser. Prints the URL regardless.

treeship hub open
treeship hub open --hub acme-corp
treeship hub open --no-open

treeship hub kill

Removes a hub connection from local config. Prompts for confirmation.

treeship hub kill acme-corp
treeship hub kill acme-corp --force

Artifacts already pushed to Hub remain there -- they are content-addressed and independently verifiable. Only the ability to push new artifacts to that workspace is removed.

Config

Hub connections are stored in ~/.treeship/config.json:

{
  "hub_connections": {
    "default": {
      "hub_id": "hub_661e5463912d",
      "key_id": "key_9f8e7d6c",
      "endpoint": "api.treeship.dev"
    },
    "work": {
      "hub_id": "hub_a2b3c4d5e6f7",
      "key_id": "key_9f8e7d6c",
      "endpoint": "api.treeship.dev"
    }
  },
  "active_hub": "default"
}

Configs from v0.1/v0.2 (flat hub object) are automatically migrated to the new hub_connections format on first run. No manual action required.