Development

Lazy

Use the lazy CLI to create apps, run the development loop, manage datasets, and inspect an app.

By Guillermo Alvarez - Published - Updated

Create an app

lazy new creates a conventional GoLazy app:

lazy new github.com/user/my_app

It selects the sample app tag that matches the current CLI version, checks for a newer CLI before remote template generation, trusts mise.toml, runs mise install, validates the app with the current go on PATH, initializes Git, renames the command directory to cmd/my_app, and commits the generated checkout with a local GoLazy identity.

Use a specific template tag only when you need it:

lazy new --version v0.1.16 github.com/user/my_old_shape

Use --skip-update-check only when the online CLI check should be skipped.

Run the development loop

From the application root:

lazy

The default command:

  • finds the app command from --cmdpath, ./cmd/<module-name>, or ./cmd/app;
  • follows the app's required golazy.dev version unless LAZY_MULTIVERSION=off is set;
  • starts configured development services when lazy.toml or :start tasks are present;
  • runs service check, create, and migrate tasks when they exist;
  • runs lazy js automatically before builds for apps with js.toml;
  • runs go mod tidy only when Go workspace mode is inactive;
  • builds a temporary lazydev binary;
  • starts the app on an internal loopback address;
  • proxies the public address over HTTP and HTTPS on the same port, defaulting to 127.0.0.1:3000;
  • serves a local HTTPS setup page over plain HTTP until the browser trusts the GoLazy local certificate authority;
  • serves the development panel at /_golazy/ over HTTPS;
  • watches files and rebuilds, restarts, reloads views, or reloads the browser according to the changed paths.

Use ADDR or PORT for a different public address:

ADDR=127.0.0.1:4000 lazy
PORT=4000 lazy

Local HTTPS

The development proxy accepts HTTP and HTTPS on the same public port. The app process still runs on an internal HTTP loopback address; only browser-facing traffic uses local HTTPS.

Open the HTTP address first. If your browser already trusts the GoLazy local certificate authority, the page probes https://<host>/_golazy/https-ready and redirects to the HTTPS version. Otherwise it shows a one-time setup page with OS-specific instructions and a certificate authority download.

The certificate authority is generated on demand under the user's data directory in a lazy directory. The page prints the exact certificate and private-key paths. Never share those files, commit them, or include them in support bundles. The CA is trusted once per machine or browser trust store; lazy then creates per-domain certificates in memory for hosts such as localhost, 127.0.0.1, or dev.local.

GoLazy does not install the CA automatically because operating-system and browser trust stores differ, and some paths require administrator approval. After the CA is trusted, HTTPS can negotiate HTTP/2 so the development panel, reload stream, and app requests can share a secure connection.

Services

When services are present, lazy starts foreground service tasks as managed subprocesses after the development proxy and panel are serving:

mise run postgres:start

Services start in parallel. Each service's stdout and stderr are recorded and left attached to the terminal. The development panel's Services tab shows that output in a service tree, and the bottom status bar shows stopped, not-ready, and ready service indicators that open the Services tab when clicked. The Services tab can restart, stop, or start one managed service at a time from the service list. lazy then prepares each service before starting the Go app:

postgres:check
postgres:create
postgres:migrate

Only tasks that exist are run. check is called every 500ms as the readiness gate. If it is still failing after five seconds, lazy tells you to inspect the service output and keeps checking. create and migrate should be safe to run repeatedly; failures are reported while other services continue finishing. On Ctrl-C, lazy stops the app first and then stops services. A second Ctrl-C kills child processes. Read Services for the full task contract and lazy.toml service listing.

Development panel and reloads

The same public address serves the panel at /_golazy/. The panel remains available while the app is building, running, failed to build, or crashed. It shows build state, recent output, changed files, request artifacts, routes, assets, per-service output and status, app rebuild or restart actions, and per-service restart, stop, or start actions. The BuildInfo tab also shows the last Go build's elapsed time, phase timing for fetch, load, cache, build, and link work, and the top five slowest packages, while runtime details, settings, and dependencies stay in right-side tabs.

lazydev builds read views and public files from the local filesystem. By default, lazy passes app/views and app/public into the build with -ldflags; use --viewpath or --publicpath for nonstandard layouts:

lazy --cmdpath cmd/my_app --viewpath views --publicpath public

When view files change, lazy asks the running app to rebuild its view cache through the lazydev control plane, then reloads the browser. Public file edits reload the browser without rebuilding because development assets are read from disk. Read Lazydev Mode and lazy Dev Loop Integration.

Press Ctrl-C to stop the loop. lazy interrupts the running app, waits briefly for cleanup, and exits. A second Ctrl-C forces shutdown.

Datasets

Use datasets for local service data snapshots:

lazy dump baseline
lazy load baseline

lazy dump baseline writes files such as datasets/baseline/postgres.dump by running service dump tasks. lazy load baseline passes matching dump files back to service load tasks. Read Datasets.

Assets and packages

Run JavaScript generation directly when package metadata, js.toml, or browser modules change outside the dev loop:

lazy js

Run Tailwind directly before tests and production builds, or in watch mode during UI work:

lazy tailwind
lazy tailwind --watch

lazy js and lazy tailwind choose package managers from active installed mise tools in pnpm, yarn, bun, node order. node maps to npm. Without a usable mise package-manager tool, they fall back to direct npm / npx.

Read lazy js And js.toml, Stylesheets And Tailwind, and Embedded Assets.

Inspect and maintain

Print the app route table without starting the HTTP server:

lazy routes

Inspect GoLazy package docs from the current module:

lazy docs
lazy docs controller
lazy docs --json

Apply supported app migrations:

lazy upgrade --target v0.1.16

Run or build through the native desktop helper:

lazy native
lazy native build --out dist/desktop

Check the CLI version:

lazy --version

The public lazy manual lists the command synopsis.