Help us shape the future of Go! Take the 2026 Go Developer Survey

lightwave-cli

module
v0.0.0-...-06d89f4 Latest Latest
Warning

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

Go to latest
Published: Oct 5, 2026 License: MIT

README

lightwave-cli

CI Go Report Card Go Reference

lw is the LightWave platform's deterministic CLI surface — the single front door agents and operators use instead of raw vendor tooling. It mediates between:

  • the agile artifact stamp (lightwave-core SST) that declares the shapes everything conforms to,
  • the platform's PostgreSQL and its API, where epics, stories, sprints and tasks actually live, and
  • vendor APIs — AWS and GitHub.

Every operation here is a tool an agent can call deterministically instead of hallucinating prose. Repo-quality discipline — ratcheted golangci-lint, hook gates, JUnit test reports, an OS+arch build matrix, and a schema-drift gate — keeps that surface honest across every consumer.

Why a CLI and not a prompt

An agent fails a step only when the model gets it wrong and nothing catches it. Model capability lowers the first probability; lw lowers the second — compilers, schema validation, drift gates and tests are cheap, deterministic, and identical on every run.

That is the whole argument for this repo. It is not competing with model capability; it is what makes a cheaper model a rational choice for a given step. The corollary is that a check which reports success without actually covering the surface is worse than no check: it lowers the apparent failure rate and not the real one. Gates here are expected to prove their own coverage.

Install

mise run lw:sync

Builds from source and installs to ~/.local/bin/lw in about three seconds. The task is defined at fleet level in ~/dev/mise.toml, so it runs from any repo under ~/dev, not just this one.

~/.local/bin precedes /opt/homebrew/bin on PATH, so the build you just made is the lw your shell and the project hooks resolve. The task verifies exactly that and warns if something still shadows it.

lw version reports git describe output — e.g. 3.14.0-5-gf91df3c-dirty — so a source build is always distinguishable from a clean tagged release. Override the checkout with LW_CLI_ROOT to build from a worktree.

Why not Homebrew? lw is the command spine of this machine's shell. Moving a binary from this repo onto this machine should not require a tag, a CI run, a GoReleaser pipeline, a separate tap repo and a brew upgrade. That chain exists to serve other people's machines. The lightwave-media/homebrew-tap repo was deleted on 2026-09-16 and the brews: block is gone from .goreleaser.yaml; tagged releases still publish cross-platform tarballs to the GitHub Releases page.

Still don't go install ./cmd/lw. It writes ~/go/bin/lw, which is behind /opt/homebrew/bin on PATH — so if a Homebrew lw is still installed it wins and you will believe your change is live when it isn't. mise run lw:sync exists to make that failure impossible.

Quickstart

# Bring up the local platform stack (preflight-gated)
lw local up

# Run the code-quality and drift checks CI runs
lw check

# Create a task end-to-end — the title is positional
lw task create "describe the change" --type=fix --label=cli --assign=<github-user>

# Explore the surface
lw --help
lw <command> --help

Each top-level command owns a group of verbs (lw task --help, lw db --help, lw check --help). An unknown verb exits non-zero rather than printing help and reporting success — including with --help on the line, which is how callers ask whether a command exists. Until #426 that form exited 0 and printed the parent's help, so probing for a verb returned the same answer whether it existed or not.

Note on wording. These groups are spelled domains: in the commands.yaml stamp and in internal/cli/dispatcher.go. That is a CLI-internal sense of the word and is unrelated to createOS Life Domains. This README says top-level command to keep the two apart; the schema key is tracked for rename separately.

Exposed today

45 top-level commands ship in the current build:

audit      check      codegen    completion compose    config
context    create     db         deploy     docs       epic
factory    failure    git        health     help       home
hooks      infra      issue      kickoff    lineage    lint
local      mcp        memory     plan       process    release
research   runbook    scaffold   schema     secret     self
session    site       sprint     story      task       ui
version    voice      worktree

Not everything in the source tree is exposed. Commands whose backing stack is gone are decommissioned in internal/cli/command_status.go — hidden from --help and refusing to run — so a release tag never advertises a command that cannot work. Regenerate the list above with lw --help.

The surface is schema-driven

The command surface is declared in lightwave-core at src/schemas/interfaces/cli/commands.yaml and dispatched at startup by internal/cli/dispatcher.go. Two invariants hold in both directions:

  • no schema entry without a registered Go handler — otherwise the subcommand is reachable but unimplemented;
  • no registered handler without a schema entry — otherwise the command is unreachable from the dispatcher's tree.

lw check schema enforces both. It is a required CI gate on every PR, not a build-time check — drift blocks the merge. Run it yourself before pushing anything that adds, renames, or removes a handler or a commands.yaml entry:

LW_CHECK_SCHEMA_STRICT=1 ./bin/lw check schema

Exit 1 on drift; without the env var the same report prints and exits 0.

Commands still under construction carry _status: in_development in the stamp: the dispatcher hides them and the drift gate excludes them, so a surface can be declared before its handlers exist without publishing a command nobody can invoke.

Releasing

The tag is the version. Push a tag and the org release plane does the rest — GoReleaser builds the cross-platform binaries and creates the GitHub release. There is no longer a Homebrew formula step; releases serve other machines, while this one installs from source (see Install).

lw release tag --dry-run   # compute the next SemVer, change nothing
lw release tag             # tag and push it

The next version is derived from conventional commits since the last tag (! or BREAKING CHANGE → major, feat → minor, otherwise patch). Tagging is refused unless HEAD is origin/main.

Contributing

Repo conventions live in AGENTS.md — it is canonical and read by every agent surface; CLAUDE.md is a thin pointer to it. It covers test patterns, git discipline, the lw check subcommand requirements, the destructive-command --dry-run/--yes standard, the release path, and the push circuit breaker. Read it before opening a PR.

Done means mise run ci green plus a test that pins the change.

License

MIT — see LICENSE.

Directories

Path Synopsis
cmd
lw command
internal
adr
Package adr reserves Architecture Decision Record identifiers atomically and renders the skeleton the stamp requires.
Package adr reserves Architecture Decision Record identifiers atomically and renders the skeleton the stamp requires.
aws
blueprint
Package blueprint resolves a named blueprint from the canonical lightwave-core blueprint library and renders it with the Gruntwork `boilerplate` engine, which is linked in as a library.
Package blueprint resolves a named blueprint from the canonical lightwave-core blueprint library and renders it with the Gruntwork `boilerplate` engine, which is linked in as a library.
cli
Package cli wires the lw cobra command tree: the schema-driven dispatcher for migrated domains plus the hardcoded commands not yet in the lightwave-core schema.
Package cli wires the lw cobra command tree: the schema-driven dispatcher for migrated domains plus the hardcoded commands not yet in the lightwave-core schema.
codegen/gogen
Package gogen generates Go structs and PostgreSQL DDL from SST entity YAML schemas declared in lightwave-core/src/schemas/data/.
Package gogen generates Go structs and PostgreSQL DDL from SST entity YAML schemas declared in lightwave-core/src/schemas/data/.
codegen/zodgen
Package zodgen emits Zod TypeScript from lightwave-core's data/ui schema family and ui_* enum stamps.
Package zodgen emits Zod TypeScript from lightwave-core's data/ui schema family and ui_* enum stamps.
corestamp
Package corestamp is a vendored copy of lightwave-core's Go binding for the SST (ADR-0003, Wave 1).
Package corestamp is a vendored copy of lightwave-core's Go binding for the SST (ADR-0003, Wave 1).
cron
Package cron reconciles the scheduled jobs the stamp declares against the launchd agents this machine actually runs.
Package cron reconciles the scheduled jobs the stamp declares against the launchd agents this machine actually runs.
db
Package db holds the CLI's data access: the Postgres platform pool and the local-first SQLite store that backs the desktop surface.
Package db holds the CLI's data access: the Postgres platform pool and the local-first SQLite store that backs the desktop surface.
docsfactory
Package docsfactory implements the spec/ + docs/ factory verbs: `lw docs spec-lint`, `lw docs check`, and `lw docs sync`.
Package docsfactory implements the spec/ + docs/ factory verbs: `lw docs spec-lint`, `lw docs check`, and `lw docs sync`.
docsgate
Package docsgate emits structured cure payloads for the docs commit gate.
Package docsgate emits structured cure payloads for the docs commit gate.
git
Package git provides a wrapper for git operations via subprocess.
Package git provides a wrapper for git operations via subprocess.
githuborg
Package githuborg bootstraps lightwave-media GitHub org assets (swarm labels, milestones).
Package githuborg bootstraps lightwave-media GitHub org assets (swarm labels, milestones).
homepolicy
Package homepolicy syncs operator baseline policy stamps from the lightwave-home blueprint into ~/.lightwave without a full home render.
Package homepolicy syncs operator baseline policy stamps from the lightwave-home blueprint into ~/.lightwave without a full home render.
kickoff
Package kickoff implements the kickoff interview gate for .tasks/<session>/kickoff/.
Package kickoff implements the kickoff interview gate for .tasks/<session>/kickoff/.
knowledge
Package knowledge reconciles Notion projections with durable local prints.
Package knowledge reconciles Notion projections with durable local prints.
maintenance
Package maintenance measures the rendered ~/.lightwave print against the shape lightwave-core stamps for it, and repairs the drift it is safe to repair.
Package maintenance measures the rendered ~/.lightwave print against the shape lightwave-core stamps for it, and repairs the drift it is safe to repair.
mcp
Package mcp implements `lw mcp serve`: a stdio MCP server with persona-tier tool filtering (ADR LWAI-0002).
Package mcp implements `lw mcp serve`: a stdio MCP server with persona-tier tool filtering (ADR LWAI-0002).
mddocs
Package mddocs reads markdown-canonical LightWave artefacts (tasks, user stories, epic briefs, sprints, DDDs) from `lightwave-media/docs/`.
Package mddocs reads markdown-canonical LightWave artefacts (tasks, user stories, epic briefs, sprints, DDDs) from `lightwave-media/docs/`.
mdindex
Package mdindex builds the read-fast cache over the markdown-canonical artefact tree under `lightwave-media/docs/<domain>/`.
Package mdindex builds the read-fast cache over the markdown-canonical artefact tree under `lightwave-media/docs/<domain>/`.
mdtasks
Package mdtasks is the WRITE surface for markdown-canonical task artefacts in `lightwave-media/docs/<domain>/tasks/`.
Package mdtasks is the WRITE surface for markdown-canonical task artefacts in `lightwave-media/docs/<domain>/tasks/`.
memory
Package memory is the v_core persisted-state KV store referenced in Phase 3 of the EB-001 plan (lw memory put|get|list).
Package memory is the v_core persisted-state KV store referenced in Phase 3 of the EB-001 plan (lw memory put|get|list).
nulltickets
Package nulltickets is the lw side of the nulltickets HTTP API for the issue loop: create a task, list a stage, claim one task by id, move it.
Package nulltickets is the lw side of the nulltickets HTTP API for the issue loop: create a task, list a stage, claim one task by id, move it.
observability
Package observability appends measured CLI events to ~/.lightwave/observability and emits agent feedback lessons on failure.
Package observability appends measured CLI events to ~/.lightwave/observability and emits agent feedback lessons on failure.
release
Package release implements ADR-0035 feature-flag evaluation and release train gates.
Package release implements ADR-0035 feature-flag evaluation and release train gates.
research
Package research is a thin client over the Perplexity API, exposing a single research primitive used by `lw research`.
Package research is a thin client over the Perplexity API, exposing a single research primitive used by `lw research`.
runbook
Package runbook is the agent execution kernel for published Gruntwork runbooks (ADR-0039, brief 2).
Package runbook is the agent execution kernel for published Gruntwork runbooks (ADR-0039, brief 2).
secrets
Package secrets turns SSM /lightwave/prod/ parameters into environment variables.
Package secrets turns SSM /lightwave/prod/ parameters into environment variables.
sitegen
Package sitegen implements lw site init: instantiate the site_config stamp (lightwave-core data/ui) for a new domain.
Package sitegen implements lw site init: instantiate the site_config stamp (lightwave-core data/ui) for a new domain.
sst
Package sst provides nested command flattening for domain fragments and voice subcommands.
Package sst provides nested command flattening for domain fragments and voice subcommands.
task
Package task is the SOP-mirror manual-fallback surface for v_core's resident-orchestrator pipeline.
Package task is the SOP-mirror manual-fallback surface for v_core's resident-orchestrator pipeline.
testutil
Package testutil provides shared helpers for tests across the lightwave-cli codebase: a Postgres pool opener that skips when no fixture DB is available, builders for createOS planning entities (Epic / Sprint / Story / Task), and a handler invoker that captures stdout so dispatcher-driven handlers can be exercised without spinning up the full cobra tree.
Package testutil provides shared helpers for tests across the lightwave-cli codebase: a Postgres pool opener that skips when no fixture DB is available, builders for createOS planning entities (Epic / Sprint / Story / Task), and a handler invoker that captures stdout so dispatcher-driven handlers can be exercised without spinning up the full cobra tree.
testutil/gitfixture
Package gitfixture is the environment for every git call that BUILDS a test fixture.
Package gitfixture is the environment for every git call that BUILDS a test fixture.
uicatalog
Package uicatalog lists and searches lightwave-ui components so a developer can match a need against existing variants before scaffolding.
Package uicatalog lists and searches lightwave-ui components so a developer can match a need against existing variants before scaffolding.
uisync
Package uisync implements lw ui add/sync: copy-in distribution of lightwave-ui components with a provenance manifest, per the UI factory initiative (decisions 1, 4, 5) and the site_config stamp's ui_release/ComponentPin shape (lightwave-core data/ui).
Package uisync implements lw ui add/sync: copy-in distribution of lightwave-ui components with a provenance manifest, per the UI factory initiative (decisions 1, 4, 5) and the site_config stamp's ui_release/ComponentPin shape (lightwave-core data/ui).
vcore
Package vcore is the daemon-lifecycle wrapper around the vcore binary that lives in lightwave-sys.
Package vcore is the daemon-lifecycle wrapper around the vcore binary that lives in lightwave-sys.
voice
Package voice implements v_speak registry resolution, ceremony sessions, and nullhub nullvoice synthesis for lw voice commands.
Package voice implements v_speak registry resolution, ceremony sessions, and nullhub nullvoice synthesis for lw voice commands.
worktreelock
Package worktreelock answers one question with a fact instead of a guess: is an agent session working in this worktree right now?
Package worktreelock answers one question with a fact instead of a guess: is an agent session working in this worktree right now?

Jump to

Keyboard shortcuts

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