Hania Code

Machines & pairing

A machine is a server or laptop that Hania Code can operate on. You pair it once, run a small daemon on it, and from then on any agent with a coding tool pointed at it can read, edit, and run commands there. Machines are managed from Machines in the sidebar, under Build.

The daemon connects outward to Hania and holds that connection open. The machine needs no inbound ports and no public address, so a laptop behind a home router works the same as a cloud server.

Pair a machine

  1. Install the runner on the machine, if it isn't there yet:
    curl -fsSL https://app.hania.ai/install.sh | bash
  2. On the Machines page, use Pair machine and give it a name. Names are unique within your workspace.
  3. Pairing shows a one-time machine key. Use it in one of two ways:
    • On a server - run the daemon with it, so agents can work on the machine any time:
      hania runner --url wss://app.hania.ai/api/runners/ws --token <key>
    • In the terminal client - paste it at hania's machine-key prompt (or with /machine during a session). The client resolves the key to this exact machine; it never creates one of its own. Coding then runs on it, in the folder you launched hania from.
The token is shown once. It is never stored in readable form and cannot be shown again. Copy it before closing the dialog. If you lose it, rotate the key to get a new one.
If hania is not found right after installing, the installer put it in ~/.hania/bin and added that to PATH for new shells only. Restart the shell, run export PATH="$HOME/.hania/bin:$PATH" in the current one, or use the full path ~/.hania/bin/hania.

The machine key starts with hania_mk_. It is not the hania_sk_ key the terminal client signs in with; see Sign in for the difference.

As long as the machine stays active in the console, coding on it keeps working. Remove it and anything connecting with its key - the daemon, or a terminal session - stops being able to.

Connection status

Once the daemon connects, the machine shows as Connected on the Machines page, along with its hostname, operating system and architecture, runner version, and when it was last seen. Those details appear after the first connection; a machine that has been paired but never connected shows only its name. A machine whose daemon is not currently running shows as Offline, and coding on it fails until the daemon is started again.

Rotate a key

Use Rotate key on a machine to replace its key. The old key stops working immediately, and the new one is shown once, the same as at pairing. The machine shows as Offline until its daemon is restarted with the new key - or, in the terminal client, until the new key is pasted at /machine. Rotate when a key may have leaked, or when you lost one and need a fresh copy; there is no need to remove and re-pair the machine.

Remove a machine

Removal is two steps, so a revoked machine stays visible until you clear it out:

  1. Revoke - the token stops working immediately and any live connection is dropped. The row stays in the list, marked Revoked, and coding tools pointed at the machine stop working.
  2. Remove - on an already revoked machine, this deletes the row and frees the name for pairing again.

Plan limits

Paired machines are available on paid plans, not on Free. Your plan caps how many machines a workspace can pair; at the cap, pairing another is refused with a machine limit message and an option to upgrade. See Plans & usage.