Machines

Add a machine

A host is any machine of yours that hup reaches over ssh: another Mac, a Linux machine, a server on your tailnet. Your agents run there, and you can open them from each of your devices.

Accurate for hup Mac 0.1.483iPad and iPhone 1.1.3

Before you start

From a terminal on your Mac, ssh devbox should open a shell without asking for a password. hup uses your own ssh setup, with your keys, your agent and your ~/.ssh/config, and it never asks for a password itself. If you haven’t connected to the host with ssh before, connect once by hand so its key is in ~/.ssh/known_hosts.

Add a host on your Mac

  1. Open hup ▸ Settings… () and choose Hosts.

  2. Under Found on this Mac, hup lists the hosts in your ~/.ssh/config and the machines on your tailnet. Add one from there, or choose Add Host… and give it a name and the address you’d give ssh.

  3. Choose Test Connection. It says whether hup reaches hupd on the host, and shows ssh’s error if it doesn’t.

hup installs hupd on the host the first time it connects, and updates it later without ending the sessions it’s running.

hup’s Settings window on the Hosts tab. Three hosts are listed: devbox, build-01 and a Sprite named scratch. Under them are the Fly.io sign-in and two machines found on the Mac, each with an Add button.
Settings ▸ Hosts on a Mac: your hosts, your Fly.io sign-in, and the machines hup found.

Open a tab there

Press , or click the small badge left of the tabs in the title bar. It reads This Mac in a window on your Mac, and the host’s name in a window on a host. New Tab On… lists every place a pane can run:

The New Tab On list in a hup window. A bar at the top has Tab, Split Right and Split Down. Under it are This Mac, This Mac in another folder, This Mac in Nono, This Mac in Nono with a profile, the hosts devbox and build-01, and two machines hup can set up.
New Tab On… on a Mac. The bar at the top opens the place as a tab or as a split.

The bar under the list’s filter chooses how it opens: Tab, Split Right or Split Down, and moves between them. That’s how you get a shell on this Mac next to an agent on a host, in one tab. The list on iPad and iPhone has the same bar.

Mac A shell on this Mac starts in the focused pane’s folder. For another folder, choose This Mac, in Another Folder…, or type a path such as ~ or ~/code into the filter. The list then shows the folders that path names on this Mac. It also shows a row for each host, for a shell in that folder there.

iPadiPhone A shell on a host starts in its home folder. For another folder, choose In Another Folder…, or type a path such as ~/code into the filter. The list then shows a row for each host, for a shell in that folder there. If the host has no such folder, the shell starts in the home folder.

After that, the usual shortcuts stay on the same machine. A new tab () or split () opens on the focused pane’s host, in its directory. Each pane’s header shows its host’s name, so you can always tell where you’re typing.

On your iPad and iPhone

An iPad or iPhone connects with a key of its own. Add your machine there in a couple of minutes.

Over Tailscale

hup connects to whatever address you give it, so a machine’s tailnet name works anywhere your tailnet does: at home or away. There’s no hup server in between: the connection is ssh from your device to your machine.

Forward a port

Some things an agent starts on a host answer only on that host: a sign-in page that ends at http://localhost:1455, or a dev server on port 3000. A forwarded port lets the browser on your Mac reach them.

  1. Open the host’s page in Settings ▸ Hosts.

  2. Under Port forwards, type the ports, with commas between them: 1455, 3000.

  3. Open a pane on that host. While one is open, localhost:3000 on your Mac leads to port 3000 on the host.

To use a different port on your Mac, write two: 8080:3000 leads your Mac’s port 8080 to the host’s port 3000.

iPadiPhone Open the host in Settings and type the ports under Port forwards. The port then leads from that device: localhost:3000 in Safari on your iPad reaches port 3000 on the host.

iPad Keep hup on screen beside Safari, with a pane open on that host.

iPhone The port stays open for about half a minute after you switch from hup to Safari. That’s enough for a sign-in page.

hup listens on your Mac’s own loopback address only, so no other machine on your network can use a forward. Each connection travels over ssh, as your panes do. If another program on your Mac already has the port, the host’s page shows a message that the port is in use. Sprites don’t have port forwards.

Host keys

Mac Your Mac’s ssh decides which hosts to trust, from ~/.ssh/known_hosts, as in any terminal.

iPadiPhone hup shows a new host’s key with its fingerprint and waits for Trust This Key. If a host’s key ever changes, hup stops connecting and shows the new key. Choose Replace the Key… only when you know why it changed, such as a machine you reinstalled.

hupd on the host

hupd is one small program at ~/.local/share/hup/bin/hupd. It needs no root and opens no port: hup reaches it through ssh. A host’s page in Settings has Check hupd, and from a shell on the host you can run it yourself:

~/.local/share/hup/bin/hupd ls        # the sessions it's running
~/.local/share/hup/bin/hupd kill ID   # end one