local-preview

command module
v0.25.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 22, 2026 License: GPL-3.0 Imports: 3 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

README ΒΆ

local-preview

Test status Deploy Status Docs Go Reference PyPI

A local-first preview-deployment orchestrator: every commit of a registered git repository becomes a servable preview at its own subdomain (<sha>-<repo>.preview.localhost:8080), built once, deduplicated by content, and served from a single binary.

local-preview resolves each commit into a (frontend artifact, backend artifact) pair by content-addressing the relevant subtrees. Commits that don't touch the frontend (or backend) reuse the existing artifact β€” and the already-running backend process. Backend state follows git lineage: a new backend version forks its data from the nearest deployed ancestor, so previews feel continuous on a straight line of commits while divergent branches can never corrupt each other.

Install

uv tool install local-preview

This installs the binary to ~/.local/bin/preview. Make sure to have that on your PATH.

Run

preview serve

The server listens on :8080. Open http://localhost:8080/ for the dashboard.

Or with Docker Compose:

docker compose up -d

πŸ“– Documentation

Full documentation lives at https://jmelahman.github.io/local-preview/:

  • Quickstart β€” register a repo, deploy a commit, open the preview.
  • Configuration β€” flags and env vars.
  • REST API β€” endpoints exposed by the running server.
  • CLI β€” serve, repo, deploy, install-hook.

Documentation ΒΆ

The Go Gopher

There is no documentation for this package.

Directories ΒΆ

Path Synopsis
cmd
internal
api
Package api defines the HTTP surface served at the apex host: JSON endpoints under /api/ plus the embedded dashboard SPA at /.
Package api defines the HTTP surface served at the apex host: JSON endpoints under /api/ plus the embedded dashboard SPA at /.
build
Package build turns deploy requests into published artifacts.
Package build turns deploy requests into published artifacts.
client
Package client is a small HTTP client for the app's REST API, used by the CLI subcommands in cmd/server.
Package client is a small HTTP client for the app's REST API, used by the CLI subcommands in cmd/server.
clone
Package clone runs repo registrations' mirror clones in the background.
Package clone runs repo registrations' mirror clones in the background.
config
Package config resolves where the application keeps its on-disk state and how its previews are addressed publicly.
Package config resolves where the application keeps its on-disk state and how its previews are addressed publicly.
db
Package db wraps the SQLite store.
Package db wraps the SQLite store.
devcontainer
Package devcontainer parses the subset of a target repository's devcontainer.json the orchestrator honors when defaulting builds and runs into the repo's dev container: the image, its named cache volumes, and the remote user's home (so toolchain caches resolve where the dev container put them).
Package devcontainer parses the subset of a target repository's devcontainer.json the orchestrator honors when defaulting builds and runs into the repo's dev container: the image, its named cache volumes, and the remote user's home (so toolchain caches resolve where the dev container put them).
dockerapi
Package dockerapi is a deliberately tiny Docker Engine API client β€” plain HTTP over the unix socket, no SDK dependency β€” sufficient to run one-shot build-step containers: ensure an image, create/start a container, stream its output, wait, remove.
Package dockerapi is a deliberately tiny Docker Engine API client β€” plain HTTP over the unix socket, no SDK dependency β€” sufficient to run one-shot build-step containers: ensure an image, create/start a container, stream its output, wait, remove.
fleet
Package fleet is the control node's view of the elastic worker tier: a heartbeat-tracked registry plus placement.
Package fleet is the control node's view of the elastic worker tier: a heartbeat-tracked registry plus placement.
githuboidc
Package githuboidc verifies GitHub Actions OIDC tokens so a CI workflow can authenticate to the API without a shared secret.
Package githuboidc verifies GitHub Actions OIDC tokens so a CI workflow can authenticate to the API without a shared secret.
githubsso
Package githubsso implements interactive "Sign in with GitHub" login for human dashboard users via the GitHub OAuth web-application flow, and the same identity resolution for a GitHub personal-access token a CLI presents as a bearer.
Package githubsso implements interactive "Sign in with GitHub" login for human dashboard users via the GitHub OAuth web-application flow, and the same identity resolution for a GitHub personal-access token a CLI presents as a bearer.
gitrepo
Package gitrepo manages the orchestrator's mirror clones and exposes the git plumbing the pipeline needs: ref resolution, tree listing (for content addressing), file reads at a commit, ancestry walks, and tree extraction.
Package gitrepo manages the orchestrator's mirror clones and exposes the git plumbing the pipeline needs: ref resolution, tree listing (for content addressing), file reads at a commit, ancestry walks, and tree extraction.
hashkey
Package hashkey computes the content-address of a commit's frontend and backend partitions.
Package hashkey computes the content-address of a commit's frontend and backend partitions.
manifest
Package manifest parses preview.toml, the contract a target repository declares so the orchestrator can build and run it.
Package manifest parses preview.toml, the contract a target repository declares so the orchestrator can build and run it.
proxy
Package proxy is the top-level request router.
Package proxy is the top-level request router.
reconcile
Package reconcile guarantees that every live deploy's build artifacts exist β€” and verify β€” in the durable tier.
Package reconcile guarantees that every live deploy's build artifacts exist β€” and verify β€” in the durable tier.
retain
Package retain enforces the instance's artifact retention policy: a periodic (or on-demand) sweep that evicts deploys exceeding a per-repo count or age limit, reclaiming their artifacts, state, and logs via supervise.Manager.GCDeploy.
Package retain enforces the instance's artifact retention policy: a periodic (or on-demand) sweep that evicts deploys exceeding a per-repo count or age limit, reclaiming their artifacts, state, and logs via supervise.Manager.GCDeploy.
s3store
Package s3store is the durable artifact tier: a content-addressed object store (S3 or any S3-compatible endpoint such as MinIO) that outlives the local disk cache.
Package s3store is the durable artifact tier: a content-addressed object store (S3 or any S3-compatible endpoint such as MinIO) that outlives the local disk cache.
store
Package store owns on-disk content-addressed artifacts and mutable backend state directories.
Package store owns on-disk content-addressed artifacts and mutable backend state directories.
supervise
Package supervise owns preview process lifecycles: one process per distinct artifact per repo (backends, and process-mode frontends), started on demand, health-checked, and stopped as a unit.
Package supervise owns preview process lifecycles: one process per distinct artifact per repo (backends, and process-mode frontends), started on demand, health-checked, and stopped as a unit.
usage
Package usage measures the instance's disk footprint: how many bytes the artifacts, backend state, logs, mirror clones, staging area, and database occupy, totalled and broken down per repo.
Package usage measures the instance's disk footprint: how many bytes the artifacts, backend state, logs, mirror clones, staging area, and database occupy, totalled and broken down per repo.
watch
Package watch polls watched repos' mirror clones and deploys new branch tips β€” the trigger for repos that push somewhere the server can fetch from but can't run a post-commit hook or deliver a webhook.
Package watch polls watched repos' mirror clones and deploys new branch tips β€” the trigger for repos that push somewhere the server can fetch from but can't run a post-commit hook or deliver a webhook.
workerapi
Package workerapi is the internal transport between a control node and an elastic worker.
Package workerapi is the internal transport between a control node and an elastic worker.
Package orchestrator is the embeddable API of local-preview: everything the standalone server does β€” mirror clones, content-addressed builds, on-demand supervised backends, lineage-forked state, Host-header preview routing β€” behind a small facade another Go application can wire into its own HTTP server.
Package orchestrator is the embeddable API of local-preview: everything the standalone server does β€” mirror clones, content-addressed builds, on-demand supervised backends, lineage-forked state, Host-header preview routing β€” behind a small facade another Go application can wire into its own HTTP server.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL