Run isolated copies of your stack locally for you and your agents.

localspace sits between your coding agents and your stack. Each agent, each reviewer and you get a full running copy of the app, with its own branch, ports, database and HTTPS address.

$curl -fsSL https://sanlilab.github.io/localspace/install.sh | sh

Then run lo setup one time.View the script

Animation: in a coding agent's chat, the developer asks agent 1 to fix the auth bug in SLAB-421. The agent runs lo new SLAB-421, which asks localspace for a copy of the app on the branch fix/auth. The localspace dashboard adds the row SLAB-421, Agent 1's copy, starts its five services one by one until it is up, and lo open shows that copy in a browser at https://frontend.slab-421.lo:7443, next to your copy on main and the copies of agents 2 and 3.

Each workspace is a full copy of your app (website, API, database) on its own branch, at its own address. No two copies share a port or a database.

Why I built localspace

I often work on several tickets across different projects at the same time. Each task needs its own services, branches and sometimes a different project structure. Every time I changed tasks, I had to stop my current setup and start another one.

I wanted to keep these environments running side by side. I looked for a tool that could manage them with git worktrees, but I could not find one that met my needs. So I built localspace.

Beforeeach time I changed tasks
  1. Stop running servicesdocker compose down
  2. Stash changes and switch branchesgit stash && git checkout fix/auth
  3. Change service portsPORT=3001
  4. Update environment variables.env
  5. Restart servicesnpm run dev
Then all of it again for the next task.
Nowwith localspace
mainplatform · mainup
SLAB-418platform · feature/checkoutup
SLAB-421platform · fix/authup
SLAB-425platform · feature/searchup

I open a workspace for each task and keep the others running.

Each workspace has its own git worktrees, so switching branches never affects my other tasks.

One template, many workspaces

A template is the foundation of every workspace. You describe your system one time in a localspace.yaml file. Every workspace follows the same description, with its own branches, services and resources.

~/.localspace/templates/platform/localspace.yaml
defaults:  ref: main repos:  frontend: ~/code/frontend  booking-service: ~/code/booking-service services:  frontend:    repo: frontend    port: 3000    expose: true    env:      API_URL: ${booking-service.public_url}  booking-service:    repo: booking-service    port: 8080    expose: true    remotes:      staging:        url: https://booking.staging.example.com    env:      DATABASE_URL: ${booking-db.url}      PAYMENTS_URL: ${payments.url}      PAYMENTS_KEY: ${payments.api_key} resources:  booking-db:    kind: postgres    version: 16    seed: seeds/booking.sql.gz external:  payments:    url: https://api.payments.example.com    attrs:      api_key: ${secret:payments/api_key}
$lo new SLAB-421 --template platform frontend=fix/auth
mainup
platform · mainAPI_URL=https://booking-service.main.lo:7443
SLAB-418up
platform · feature/checkoutAPI_URL=https://booking-service.slab-418.lo:7443
SLAB-421up
platform · fix/authAPI_URL=https://booking-service.slab-421.lo:7443
SLAB-425up
platform · feature/searchAPI_URL=https://booking-service.slab-425.lo:7443
  • Define onceDescribe your repositories, services and resources in a template that your whole team can share.
  • Keep workspaces separatelocalspace resolves the references for each workspace, so services connect to their own resources.
  • Create and recreateCreate a workspace, remove it with lo rm when you finish, and make it again from the same template when you need it.
  • Connect to external servicesUse local services, remote instances or services from other workspaces without changing your application code.
$lo new SLAB-430 --template platform booking-service=remote:staging

Get started with localspace

localspace is free and open source, and runs on macOS and Linux.

  1. Install localspace

    One line downloads the release and checks it.

    $ curl -fsSL https://sanlilab.github.io/localspace/install.sh | sh
  2. Set up your machine

    Run lo setup one time. It makes local domains work and trusts the certificates.

    $ lo setup
  3. Create a workspace

    Write a template, then run lo new and lo up.

    $ lo new my-task --template platform
    $ lo up my-task

The documentation tells you everything else.

One per agent.