Skip to main content

CLI & Makefile

Binary flags

webhull [flags]
FlagTypeDefaultDescription
-configstringdeploy/config.yamlPath to the operational config file (required).
-pagesstringPath to the pages/site structure file. When set, enables split config mode.
-validateboolfalseValidate the config and exit without starting the server. Exit code 0 on success, 1 on error.
-versionboolfalsePrint the binary version and exit.

Examples

# Start with monolithic config
webhull -config site.yaml

# Start with split config
webhull -config deploy/config.yaml -pages site/pages.yaml

# Validate config without starting
webhull -config site.yaml -validate
# config OK — site="My Site" languages=[en de] pages=8

# Print version
webhull -version
# webhull 1.2.3

Setting the version at build time

The version string is set via -ldflags at build time:

go build \
-ldflags="-X github.com/layer87-labs/webhull/cmd/webhull/cmd.Version=1.2.3" \
-o build/bin/webhull \
./cmd/webhull

When not set, Version defaults to "dev".


Makefile targets

Run make help to list all targets.

Development

TargetDescription
make generateRegenerate templ templates (templ generate). Run after editing any .templ file.
make buildgenerate → compile binary to build/bin/webhull.
make runbuild → run with deploy/config.yaml + example/pages.yaml.
make devHot-reload development server via air.

Quality gate

TargetDescription
make checkFull quality gate. Runs fmt-check → vet → lint → shadow → test → audit. Required before every commit.
make fmtFormat all handwritten Go files with gofumpt.
make fmt-checkFail if any file needs formatting (CI mode).
make vetgo vet ./...
make lintstaticcheck -checks=all,-ST1000,-U1000 ./...
make shadowVariable shadow analysis (excludes generated *_templ.go files).
make testgo test ./... -race -count=1 -v -buildvcs
make test-coverTests with HTML coverage report → build/coverage/coverage.html.
make auditgo mod verify + govulncheck (binary mode when binary exists).

Maintenance

TargetDescription
make tidygo mod tidy + go mod verify.
make cleanRemove build/ and build/coverage/.
make compressCompress binary with UPX (requires upx installed).
make containerBuild container image via deploy/Containerfile.

Makefile variables

Override on the command line to match your environment:

VariableDefaultDescription
STATICCHECK_CHECKSall,-ST1000,-U1000Staticcheck check set. Matches .layer87/pipeline.yml.
TEST_FLAGS-v -buildvcsExtra flags passed to go test.
AUDIT_BINARYbuild/bin/webhullBinary path for govulncheck -mode binary.
# Override for CI without binary mode
make audit AUDIT_BINARY=""