Skip to content

localghost v4.0.0

Choose a tag to compare

@SmileyChris SmileyChris released this 08 Oct 20:34
· 49 commits to main since this release

Localghost 4.0 brings a project back with one command: localghost restart NAME stops it if it's running and starts it again the way it last ran. localghost sessions becomes the one view of your projects, showing which are running and whether in the foreground or detached, and the hub's welcome page shows the same.

Upgrade

uvx --refresh localghost --version

The hub image is rebuilt on the first localghost run or hub up, which brings in the new welcome and offline pages. Existing registry entries and session records keep working; a project last started before the upgrade shows as running in the foreground until its next run records how it was started. Check the two breaking changes below if you script against sessions list --json or still use [run].framework.

Highlights

  • localghost restart [NAME] stops a running project and starts it again from its remembered directory, re-reading .localghost.toml and the rest of its setup. It comes back the way it last ran, in the foreground or detached; --foreground or --detach picks the other way, so restart NAME --foreground brings a background app into your terminal. With no name it restarts the project you're standing in.
  • Taking over a foreground run. Foreground runs are now recorded as sessions while they run. restart can take over a project running in another terminal after you confirm, and sessions stop can end it.
  • Sessions by name. sessions logs and sessions stop take a project name; session IDs still work, and an exact ID wins.
  • One list of projects. localghost sessions lists every remembered project with whether it's running and how. status shows the same state.
  • Running state on the hub. http://localhost marks each project "Running in the foreground", "Running detached", or when it last started, using Traefik's own router list.
  • Worktrees can't collide. run refuses to start a project whose name is already served from another directory, such as a second worktree of the same repository, and suggests --name. Starting a project clears its stopped session records.

Breaking changes

  • sessions list --json returns a list of projects (the registry entry plus state and the newest session record, or null) instead of a list of session records. status --json's remembered list holds the same objects.
  • [run].framework in .localghost.toml, deprecated since 2.0, is rejected with the fix: rename it to [run].type.

Command changes

Before Now
localghost summon NAME localghost restart NAME
localghost forget NAME localghost sessions forget NAME
sessions logs SESSION_ID sessions logs NAME (IDs still work)
sessions stop SESSION_ID sessions stop NAME (IDs still work)

summon and the top-level forget still work as hidden commands and print a deprecation notice. sessions forget also removes the project's stopped session records and refuses a project that's still running. Compose labels, the localghost network and project name, and hostname conventions are unchanged.

The full list is in CHANGELOG.md.