Skip to content

runy

Kubernetes-style config for your dev environment

Declare what a workspace needs in YAML: dev servers, ports, worktrees, microVMs, watchers. The runy daemon brings them to the state you declared and keeps them there, on this computer, inside its microVMs and on the computers you pair it with.

Get startedInstall

⌄acme
devbox
sandbox
›api3
api
api
worker
›db2
data
postgres
›preview1
preview
⌄web2
web
web
Machines
OutputOverview@stdout, @stderr, field: value
17:37:30Reloading workspace
17:37:31web/port/web: Resolved · 3010 → http://web.localhost
17:37:32web/process/web: starting · pid 48213
17:37:34web/process/web: running healthy

Switch a namespace on and its resources come up. preview checks out a worktree and loads the workspace inside it. Under Machines, sandbox is a microVM on this computer with a runy daemon of its own, and lab is a paired computer: select one to see its workspace.

A workspace, run like a cluster

A cluster declares what should run and a controller makes it so. runy borrows that shape for the dev environment: resources in YAML documents, a daemon that reconciles them, status you can read.

Declare

A folder of YAML files is a source you load. Each YAML document in it is a resource, in the namespace it names: a kind, a name and a spec. A spec can read what another resource has published.

kind: process
name: web
spec:
  cmd: pnpm
  args:
    - dev
    - --port
    - ${ port.web }
  restart: { on: failure }

Reconcile

The daemon renders every document, holds one back until what it reads exists, starts what is missing and restarts what fails its health check.

port/webResolved3010
process/webPendingneeds port.web
process/webResolvedrunning healthy

Observe

Every resource publishes a condition and a status. runy ps lists them, the console shows the tree, and each line of output is kept in a journal.

{
  "state": "running",
  "pid": 48213,
  "healthy": true,
  "restarts": 0
}

Workspaces inside microVMs

A vm resource keeps a microVM running through smolvm, from an OCI image or from a template's build. With daemon: true a runy daemon runs inside: the console lists it under Machines,-m sandbox sends a command to it, and this computer's proxy serves its ports.

How vms work

A template is built once

runy build runs the build steps in a builder machine and packs its disk. Until the image or the build steps change, a later build starts the kept builder and runs only the refresh steps.

kind: template
name: devbox
spec:
  driver: smolvm
  image: debian:bookworm-slim
  net: true
  workdir: /work/acme
  ssh: true
  daemon: true
  build:
    - apt-get update
    - apt-get install -y git openssh-server
    - git clone https://github.com/acme/app /work/acme
  refresh:
    - git -C /work/acme pull -q

Each vm starts from the build

A vm with template starts with the tools and checkout the build left, and a later build leaves it alone. It gets only the secrets it lists: with credential the guest holds a stand-in, and smolvm puts the value on its HTTPS requests to the secret's hosts. A branch copies a running vm, memory and disks, in about half a second.

kind: vm
name: sandbox
spec:
  template: devbox
  branchable: true
  secrets:
    - secret: ${ secret.github }
      credential: GITHUB_TOKEN
$runy build devbox
$runy ssh-config >> ~/.ssh/config
$runy vm branch sandbox --name try-1

Pair another computer

Two daemons pair with a ticket that works once. Each proxy then serves the other's domains, the routes into its machines among them, over an encrypted connection. Names under *.localhost resolve to the loopback on every computer, so DNS stays as it is. A paired computer can call your daemon's API, so pair only computers whose users you trust.

How the mesh works
studio
$runy mesh invite
runy-mesh-4q7fz2…
on the other box: runy mesh join runy-mesh-4q7fz2…
lab
$runy mesh join runy-mesh-4q7fz2…
joined studio (3f9a1c0b7d42…)
$runy mesh ls
DomainProtocolVia
http.api.acme.lab.runy.localhosthttplocal
api.studio.runy.localhosthttpstudio
web.web.acme.studio.runy.localhosthttpstudio
web.app.acme.sandbox.studio.runy.localhosthttpstudio / machine sandbox
ssh.sandbox.studio.runy.localhosttcpstudio / machine sandbox

On lab, http://web.app.acme.sandbox.studio.runy.localhost opens the web server in the vm on studio, and ssh [email protected] reaches its sshd.

Every line of output is kept

A process's output goes to a SQLite journal the console streams. The same query filters what is stored and what arrives next.

How journals work
OutputOverview@stdout, @stderr, field: value
17:37:32Starting process: pnpm dev --port 3010
17:37:32VITE v7.3.1 ready in 412 ms
17:37:32Local: http://localhost:3010/
17:37:33[vite] hmr invalidate /src/App.tsx Could not Fast Refresh
17:37:33page reload src/config.ts
17:37:34Health check `web` passes
17:41:18hmr update /src/routes/home.tsx
17:41:18hmr update /src/styles/app.css
17:42:50hmr update /src/components/Menu.tsx
17:42:50hmr update /src/components/Menu.tsx (x2)
17:55:10TS2322: Type 'string' is not assignable to type 'number'.
17:55:10[vite] Internal server error: Transform failed with 1 error
17:55:41hmr update /src/components/Menu.tsx
17:55:41page reload src/config.ts
17:56:02Health check `web` passes

Tick @stderr, or type a word.

Up in a minute

The guide writes a first folder of resources, loads it, enables its namespace and opens the console.

$curl -fsSL https://setup.runy.dev | sh
`runy` is ~/.local/bin/runy, the stable channel.
$runy ns enable
web: up
$runy ps
web/port/webResolved3010 → http://web.localhost
web/process/webResolvedrunning healthy

Get startedGitHub