Files
ask-form/Makefile
gabrielvidalandClaude Opus 5.5 0201f90925 ask-form: your coding agent asks, you answer from anywhere
A Go tool that lets Claude Code (or any CLI agent) ask structured questions
through a private web form, answered from any browser, with the answers
returned as JSON. One binary (`ask-form`) per machine plus a public relay
(`ask-form-relay`); one-command install, releases, upgrade and auto-upgrade.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-27 23:21:48 +01:00

31 lines
1.2 KiB
Makefile

GO ?= go
VERSION ?= $(shell git describe --tags --always --dirty 2>/dev/null || echo dev)
MODULE := $(shell $(GO) list -m 2>/dev/null)
LDFLAGS := -s -w -X $(MODULE)/internal/server.Version=$(VERSION)
PLATFORMS ?= linux/amd64 linux/arm64 darwin/amd64 darwin/arm64
.PHONY: build test install dist relay-image
build: ## both binaries into bin/
$(GO) build -trimpath -ldflags "$(LDFLAGS)" -o bin/ ./cmd/...
test:
$(GO) vet ./... && $(GO) test ./...
install: ## ask-form into $(GOBIN) or ~/go/bin
$(GO) install -trimpath -ldflags "$(LDFLAGS)" ./cmd/ask-form
dist: ## release binaries for $(PLATFORMS) + checksums.txt into dist/
rm -rf dist && mkdir -p dist
for p in $(PLATFORMS); do \
os=$${p%/*}; arch=$${p#*/}; ext=; [ "$$os" = windows ] && ext=.exe; \
for b in ask-form ask-form-relay; do \
CGO_ENABLED=0 GOOS=$$os GOARCH=$$arch $(GO) build -trimpath -ldflags "$(LDFLAGS)" \
-o dist/$$b-$$os-$$arch$$ext ./cmd/$$b || exit 1; \
done; \
done
cd dist && sha256sum ask-form* > checksums.txt
relay-image: ## the relay's container image
docker build --build-arg VERSION=$(VERSION) -t ask-form-relay:local .