Spaces
← All guides

How to install and use coding agents over SSH in one command

Guide

spaces --remote you@server does the whole thing: it probes the server over SSH, installs Spaces there (or updates an old one), starts it, tunnels to it, and opens the terminal client. The server listens on loopback only, so nothing is exposed beyond your SSH login. Run the same command again to reconnect.

Before

On your laptop: Node.js 20.9 or newer, and SSH access to the server. On the server: Node.js 20.9 or newer and, on Linux, the build tools (build-essential python3) because the terminal library compiles during install. If Node is missing or too old on the server, spaces --remote says so and stops rather than guessing.

npm install -g @jlongo78/agent-spaces

The command

spaces --remote you@server

Step by step:

  1. Probe. One SSH session asks the server what it has: Node version, whether Spaces is installed, which version, and how many agents are running.
  2. Plan. No Spaces there: it offers to install. Older than yours: it offers to update, and tells you first how many running agents the update would stop. Newer than yours: it says so and connects anyway. --yes answers the questions for you.
  3. Install. npm install -g on the server, into ~/.local when the global folder needs root. No sudo.
  4. Start and tunnel. It starts the Spaces server on the remote machine and opens an SSH tunnel to its loopback port. The client on your laptop talks only through that tunnel.
  5. Connect. The terminal client opens, showing the server's spaces. ctrl+k for everything.

SSH keys, set up for you

If the server asks for a password, Spaces offers to set up key sign-in: it uses your default key, or creates ~/.ssh/id_ed25519, adds it to the server's authorized_keys, and checks that it works. You type the password once. Decline, and it remembers not to ask for that host again.

Afterwards

  • spaces --remote you@server again: reconnect. Detach with ctrl+space d; agents keep running.
  • spaces open --remote you@server: the web app for that server in your browser, signed in, through a tunnel.
  • On the server, spaces status shows the version and the agents; spaces restart restarts it; spaces service install makes it start at login.

What is and is not exposed

The Spaces server binds to 127.0.0.1 and answers only requests signed with the owner's secret. The tunnel preserves that: from the laptop it looks like a local server. There is no public port, no account to create, no telemetry. The agents run as your user on the server, without a sandbox, as they would in a plain shell.

Get started

npm install -g @jlongo78/agent-spaces
spaces

Open source, Apache-2.0, no telemetry. Source on GitHub · every feature.

More guides