Lifecycle is a terminal-native workspace runtime for software teams. It manages development workspaces across local machines, containers, remote servers, and cloud sandboxes so the same shell, stack, and service graph can move cleanly from local work to cloud-hosted runtime.
lifecycle.json is the project contract. It declares workspace prepare steps and can optionally declare a managed stack DAG (process, image, task nodes). The lifecycle CLI is the primary control surface. The bridge is the workspace-host authority for clients. The control plane on Cloudflare Workers manages cloud workspaces, terminal routing, and a routable opencode serve endpoint for remote harnesses. Sandbox providers (local, docker, remote, cloud) run the same workspace contract everywhere.
Under active development. The current execution focus is:
- CLI and TUI — workspace lifecycle, shell attach, tmux persistence, service graph operation
- Control plane — Cloudflare Workers + Durable Objects + D1 for cloud workspace lifecycle and remote terminal/OpenCode routing
- Sandbox providers — local (native), Docker, Daytona (remote/SSH), Modal (cloud)
- Terminal runtime — host-aware shell attach, remote tmux continuity, and cloud runtime parity
Desktop and web surfaces are secondary unless they directly unblock the above.
Shell into a workspace. Run opencode, claude, codex, or any tool in a tmux-backed terminal. Lifecycle manages the workspace and stays out of the way.
lifecycle project init
lifecycle workspace create
lifecycle stack run
lifecycle # tmux-backed shell — run opencode, claude, whateverCloud workspaces can expose a routable opencode serve endpoint alongside the same shell/runtime contract. External harnesses connect to that endpoint while Lifecycle still owns the workspace, terminal, services, and host-aware execution.
# Control plane provisions sandbox, starts opencode serve, and routes clients to it
# Lifecycle still owns the shell, stack, files, health, and previews
# Harness companies keep owning chat UX, model routing, and approval semanticsBoth modes share the same lifecycle.json, the same workspace environment, and the same CLI tools.
Lifecycle clients do not invent their own authority paths.
- The CLI and TUI ask the bridge to read or mutate workspace state.
- Clients address operations by workspace identity rather than resolving host placement themselves.
- The bridge layer resolves the authoritative bridge for the workspace, and only that bridge executes runtime work.
- The authoritative bridge owns shell attach, stack/service runtime control, git status, activity, and host-local execution.
- When a request needs cloud or organization authority above the workspace runtime, the bridge calls the control plane.
- When runtime state changes on the bridge side, the bridge streams lifecycle events over WebSocket and clients update UI state from those events. Routed OpenCode traffic is a secondary integration surface, not the primary UI model.
- Clients stay thin. They own presentation state such as selection, focus, and layout. They do not shell out to fresh
lifecyclesubprocesses for core reads or mutations when the bridge is available.
- CLI (
apps/cli) — workspace lifecycle, stack/service commands, bridge launcher, shell/runtime control, context dump - TUI (
apps/cli/src/tui) — CLI-owned OpenTUI surface with bridge-backed shell attach, workspace sidebar, and host-aware activity - Bridge workspace runtime (
apps/cli/src/bridge/domains/workspace) — host-aware workspace client withlocal,cloud,docker,remoteimplementations - Bridge stack runtime (
apps/cli/src/bridge/domains/stack) — process supervisor, graph lowering, health checks, logs, port management - Contracts package (
packages/contracts) — shared domain types, manifest parsing, Zod validation - DB package (
packages/db) — control-plane persistence (Turso/SQLite) - API scaffold (
apps/control-plane) — Hono-based backend - Bridge runtime (
apps/cli/src/bridge) — fixed-port bridge runtime, authority routing, routes, pid registration, client bootstrap - Native desktop app (
apps/desktop-mac) — Swift/AppKit client - Landing page (
apps/www)
The CLI noun model:
project → project contract and lifecycle.json scaffold
workspace → concrete working instance of a project
stack → live runnable graph inside a workspace
service → one named node inside the stack
context → aggregate machine-readable view for shells, tools, and harnesses
Key commands:
lifecycle project init # scaffold lifecycle.json
lifecycle proxy install # optional clean HTTP lifecycle.localhost routing
lifecycle workspace create # materialize a workspace
lifecycle workspace prepare # bootstrap the environment
lifecycle workspace shell <workspace> # attach a shell
lifecycle stack run # start the service graph
lifecycle stack status # service health dashboard
lifecycle service logs <service> # stream service logs
lifecycle context --json # structured workspace/runtime dump
lifecycle # launch the TUI
lifecycle pr create # create PR through control planeThree tiers: clients, bridge, control plane, sandbox providers.
Clients (CLI, TUI, integrations)
→ Bridge layer (workspace-id API + authority routing)
→ Authoritative bridge (workspace host + WebSocket event source)
→ Workspace runtime (tmux, git, files, stack)
→ Control Plane when org/cloud authority or routed OpenCode access is required
→ Sandbox Providers (local, docker, remote, cloud)
See docs/reference/architecture.md for the full system design.
- Bun
>=1.3.10 - Optional: Docker for container-hosted workspaces
- Optional: Daytona for remote workspaces
- Optional: Modal for cloud sandboxes
- Recommended:
justfor the documented repo workflows (just setup,just check,just dev tui,just dev desktop)
git clone https://github.com/localhost-inc/lifecycle.git
cd lifecycle
just setup
just check
lifecycle proxy install --dry-run # inspect machine-scoped preview routing changes
just dev tui # primary CLI/TUI dev pathFrom repo root:
The root justfile is the canonical workflow layer for documented repo operations. If a workflow becomes part of the standard path, add a just recipe for it and document the just command rather than the raw underlying invocation.
just --list— show the available workflowsjust setup— install dependencies and hooksjust format— apply repo formattingjust lint— lint checksjust typecheck— type checksjust test— testsjust build— workspace buildsjust checkorjust qa— full quality gatejust fix— format first, then run the full quality gatejust dev tui— primary CLI-owned TUI loop against the standard local Lifecycle runtimejust dev desktop— primary desktop loop: bridge, control plane, anddesktop-macjust tui-local— focused CLI-owned TUI loop with auto-restart against repo-local bridge + control planejust dev desktop-services— bridge + control plane only, for Xcode/native debuggingjust dev desktop-app— desktop app build/reload loop onlyjust desktop— alias forjust dev desktopjust smoke— smoke test the desktop dev loopjust bridge-generate— regenerate bridge routed/OpenAPI artifacts after route-contract changesjust xcode-env— print the canonical Xcode Run environment fordesktop-macjust status,just stop,just logs bridge— inspect and manage the owned dev services
just dev tuiandjust dev desktopare the primary entrypoints.just dev desktopowns bridge, control plane, and the native app as one supervised runtime.just statusreports both supervisor-owned services and any bridge listener already occupying the fixed dev port.- In repo dev mode, the native app only accepts a healthy bridge whose
/healthmetadata matches the current repo root. - Use
just stopbefore switching dev modes; it clears supervisor-owned processes and same-repo stale bridge listeners.
apps/
cli/ lifecycle CLI + bundled bridge runtime (`apps/cli/src/bridge`)
control-plane/ Hosted Hono control plane
desktop-mac/ Native Swift desktop app
www/ Landing page
packages/
config/ Shared TypeScript config
contracts/ Domain contracts, manifest parsing, validation
db/ Control-plane persistence
store/ Control-plane query/mutation layer
ui/ Shared UI primitives
docs/
reference/ Canonical contracts (architecture, vision, journey, TUI, shell, etc.)
plans/ Execution plans (local CLI, cloud V1, sandbox providers)
milestones/ Active milestone contracts
archive/ Historical specs
AGENTS.md Engineering playbook
- Docs Home — where to start and how the docs tree is organized
- Architecture — system design, three tiers, sandbox providers
- Vision — product direction and V1 boundaries
- Journey — narrative from local terminal work to cloud-hosted runtime
- TUI — terminal UI contract, shell attach, tmux model
- CLI — CLI command contract
- Cloud — cloud delivery plan
- Vocabulary — canonical terms
- AGENTS.md — engineering workflow and quality bar
Lifecycle is currently maintainer-led. Small fixes, docs improvements, and tightly scoped bug reports are welcome. For anything broad, read CONTRIBUTING.md and align on direction before writing a large patch.