Run a dev server for every branch

Give each branch its own worktree, dev server and saved preview on a second machine. Open each preview from Omnyo on any of your devices, and restart it from its saved command.

Hand this to your agent
Ask me about each of these, one at a time, with a suggested default:
- Branches (the branches to preview)
- Machine (an existing connected machine to run them on)
- Checkout (the repo's folder on that machine)
- Dev server command (check package.json, e.g. pnpm dev)
Skip any I've answered. Then sum up the plan in three bullets and wait for my go. My answers override the steps below.
If a wait times out, wait again, up to three times.

Run a registered dev preview for each branch on my existing connected Omnyo machine.
Guide: /guides/remote-dev-servers

Preserve other work: don't stash, reset or switch branches in an existing checkout. Don't enroll machines, expose ports, change firewall rules or create public links. If the selected machine or source isn't available, report that before starting.

1. Check omnyo machine list and omnyo project show "$OMNYO_PROJECT_ID". Confirm the named machine is online and use its existing project checkout. If that checkout isn't registered, use omnyo project source add "$OMNYO_PROJECT_ID" --path <checkout> --machine <machine>. Do not create a machine or cloud resource.
2. For each named branch, start a thread on that machine with its own worktree based on the branch's current commit. Leave uncommitted work in other checkouts alone. Use omnyo thread spawn --json --project "$OMNYO_PROJECT_ID" --machine <machine> --new-environment worktree --base-branch <branch> --title "<short task name for the branch>" --prompt "Prepare this branch's dev preview. Reuse its .omnyo-env-setup.sh and .env.local, verify the actual dev-server command and a fixed free loopback port, then register the exact executable, argv and working directory with omnyo preview register --thread <this-thread-id> --url <original-loopback-url> --cwd <worktree> -- <verified-command-and-arguments>. Register first, then omnyo preview restart <preview-id> and omnyo preview status <preview-id>. Use an existing protected launcher for credentials; never put secrets in arguments. Keep the chosen port on restart. Don't adopt or stop another server or change application code. When online, run omnyo glance servers --remember <preview-id> and return the original loopback URL with the preview ID and status."
3. Read each thread's result. If a start is uncertain, check omnyo preview status <preview-id> before retrying with omnyo preview restart <preview-id>; a restart reuses a ready run, so never launch a second copy by hand. A foreign listener is a conflict; don't kill it or silently choose a different port. An offline machine must reconnect before restart.
4. Reply with branch, machine, preview ID, readiness and the original loopback URL. On my other signed-in devices, Omnyo opens the registered private preview instead. Then offer to save these steps as an Omnyo skill in .omnyo/skills/preview-branches/SKILL.md, with my machine and verified dev server command filled in, so next time I can just ask for it.

Steps

  1. 1Choose your dev box
  2. 2Put your project on it
  3. 3Start a thread per branch
  4. 4Run and open each preview
1

Choose your dev box

Use a machine already connected to Omnyo, with the tools your project needs.

  1. Open Settings → Machines (the gear at the bottom left, then Settings, or press ⌘,) and find your dev box. If it isn't listed yet, choose Add a machine and follow the steps.
  2. Check that it shows as Online. If it shows Offline, open its ⋯ menu, choose Reconnect, and run the command it shows on that machine.
  3. Use the machine's existing checkout and development tools. You can keep working in that checkout over SSH.
2

Put your project on it

Point Omnyo at the checkout already on your dev box, and give every branch its own ports.

  1. Open Settings → Projects and choose your project.
  2. Under Checkouts, choose Set up next to the dev box. The button reads Offline until the machine reconnects.
  3. Choose Use an existing folder on your dev box and pick your checkout, or Clone from the project remote if there isn't one. Projects without a Git remote go straight to the folder picker.

Commit a setup script at the repo root. Omnyo runs it in each new worktree it creates, so every branch installs its dependencies and chooses its ports. This example uses pnpm; adapt the command and ports to your project:

Example: .omnyo-env-setup.sh
#!/usr/bin/env bash
set -euo pipefail
pnpm install --frozen-lockfile
free_port() { node -e 'const s=require("net").createServer().listen(0,"127.0.0.1",()=>{console.log(s.address().port);s.close()})'; }
printf '\nWEB_PORT=%s\nAPI_PORT=%s\n' "$(free_port)" "$(free_port)" >> .env.local
3

Start a thread per branch

Each thread gets its own worktree on the machine, so servers never step on each other.

  1. Choose New thread and pick your project below the message box. If the project is on more than one machine, pick the dev box in the machine menu.
  2. Open the branch menu next to it (it reads main) and, under Start in, choose New worktree from main. New worktrees start from your default branch. To continue in a worktree already on the dev box, pick it under Worktrees. Describe the work, then send it.
  3. To start a worktree from another branch, ask the agent, or run omnyo thread spawn --project <project-id> --machine <machine> --new-environment worktree --base-branch <branch> --title "<task>" --prompt "<what to do>". Repeat for each branch.
4

Run and open each preview

Save the server's launch command once. Omnyo can check it, reopen it and restart it in the same worktree.

  1. In the thread's worktree, verify the project's dev-server command and use the port saved in .env.local. Register that exact launch before starting it:
Terminal
$ set -a; . ./.env.local; set +a
$ omnyo preview register --thread "$OMNYO_THREAD_ID" --url "http://127.0.0.1:$WEB_PORT/" --cwd "$PWD" -- pnpm dev --host 127.0.0.1 --port "$WEB_PORT"

Use the returned preview ID with omnyo preview restart <preview-id>, then omnyo preview status <preview-id>. Wait for online before opening it.

Run omnyo glance servers --remember <preview-id> to show it in the thread's Dev servers shelf, just above the message box. On a phone, tap the server button in the thread header. Choose Open while it is Running. If it stopped or didn't start, choose Restart to run its saved command again. You can also open the loopback link returned in chat; on your other signed-in devices, Omnyo opens the registered private preview.

Ask the agent
Verify this worktree's dev-server command and fixed loopback port. Register the exact argv and cwd with omnyo preview register, restart the saved preview, and check its status. When online, remember it with omnyo glance servers --remember and return its original loopback URL. Preserve other servers and use the existing protected launcher for credentials.

Troubleshooting

The preview is not ready
  1. Run omnyo preview status <preview-id> and read the reported state.
  2. Read the detail under the server in the Dev servers shelf, or the line the status command prints, such as "Another process is using this preview port." or "The preview command exited with code 1." The server must listen on the registered loopback host and port. To see its own logs, run the same command once in the thread's terminal, stop it, then restart the preview.
  3. Use omnyo preview restart <preview-id>, or Restart in the shelf when the server stopped or didn't start, to run the saved launch again. If another program already holds the port, the shelf shows Port in use. Omnyo won't stop that program for you: stop it yourself, then restart the preview on its saved port.
Two branches fight over the same port
  1. Commit .omnyo-env-setup.sh from step 2, so each new worktree chooses its own ports.
  2. Register each server with the port in its own .env.local. Keep that port when restarting.
  3. Worktrees created before the setup script need their own port configuration; leave other worktrees unchanged.
The thread failed while setting up its worktree
  1. Open the thread and read the .omnyo-env-setup.sh failed output.
  2. Fix the script, commit it, and start a new thread. Omnyo removes a worktree whose setup failed.
  3. Make optional setup steps non-fatal only when the worktree can safely run without them.
A new worktree is missing .env or other files
  1. List them in a .worktreeinclude file at the repo root, one pattern per line.
  2. Put the files in the project's checkout on that machine. Omnyo copies them into each new worktree.
  3. Start a new thread. Keep secret values out of preview command arguments and links.
A machine shows as offline
  1. Check that its computer is on, awake, and online.
  2. In Settings → Machines, open its ⋯ menu and choose Reconnect.
  3. Run the command it shows on that machine. Its threads and worktrees are kept.
My app's sign-in or cookies do not behave as on localhost

Managed previews isolate browser storage and cookies; they do not reuse your normal app session. Redirects outside the registered server are refused, so external sign-in redirects are not supported through this preview route.

FAQ

Does live reload work?

Managed previews carry HTTP and supported WebSocket traffic to the registered server. Keep the app's dev-server URLs on that loopback endpoint.

Who can open the preview?

Only you: open it from Omnyo on any device signed in to your Omnyo. Registering a preview doesn't open a public port or create a public share link.

Can I open previews from my phone or another network?

Yes. Sign in to Omnyo connect with a free Omnyo account to reach your Omnyo, and its previews, from your phone or any browser. See Work from anywhere. You can use your own network, a company VPN or Tailscale instead. Either way, the dev server stays on loopback and needs no open firewall port.

What should already be on my dev box?

Your repo, its build tools and any local configuration. List untracked files every worktree needs in .worktreeinclude; Omnyo copies them from the existing checkout.

Can I keep working in my checkout over SSH?

Yes. Agents use their own worktrees, leaving your checkout, editor and terminals in place.

Does this work with an existing cloud dev environment?

Yes, if it is connected to Omnyo and stays awake. After a container restart, use Reconnect in Settings → Machines and run the command it shows. Registering a preview doesn't add a new machine.

How do I keep a machine from running too many agents?

Open Settings → Concurrency limit and set that machine's limit under Host limits.

What happens to a server when I archive its thread?

A server you started in the thread's terminal stops after the 30-second undo window. A registered preview belongs to the worktree: five minutes after you archive the worktree's last thread, Omnyo removes the worktree and stops every process still running in it, including the preview. The branch is kept. Use .omnyo-env-teardown.sh for cleanup outside the worktree, such as its own containers.

Does this cost anything?

No. Omnyo is free to use, with no Omnyo subscription. Registering a preview only saves its launch command in your own Omnyo; your agents run on the subscriptions you already have.

Preview every branch

Use the machines and agent subscriptions you already have.