build(cli): make bin/af-stack the canonical CLI binary - #129
Merged
Merged
Conversation
The README's lead command, `af-stack init`, errored with "unknown command" because `make build-go` compiled the runtime server to bin/af-stack — the CLI source at services/cli/cmd/af-stack was never built. Two different `main` packages both produce a binary named `af-stack`, and the build wired up the wrong one. Resolve the collision in favour of the CLI, per the CLI-first direction: - build-cli (strict): services/cli/cmd/af-stack -> bin/af-stack. This is the front door, so a broken CLI now fails the build instead of being skipped. - build-runtime: services/runtime/cmd/af-stack -> bin/af-stack-runtime, for local non-container runs without shadowing the CLI. The runtime container build is unaffected (its Dockerfile builds /usr/local/bin/af-stack in its own context). - install-cli: `go install` the CLI onto PATH for an npm-like front door. - smoke-cli: regression guard asserting the built binary is the CLI. - build-go kept as a back-compat alias (now builds both). bin/af-stack init / version / help now reach the CLI as documented. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What & why
The README's lead command
af-stack initerrored withunknown command: the Makefile built the runtime server tobin/af-stack, so the CLI source atservices/cli/cmd/af-stackwas never built. Twomainpackages both produce a binary namedaf-stack, and the build wired up the wrong one.Per the CLI-first direction, resolve the collision in favour of the CLI:
services/cli/cmd/af-stack→bin/af-stack— the front door, so a broken CLI now fails the build instead of being skipped.services/runtime/cmd/af-stack→bin/af-stack-runtime, for local non-container runs without shadowing the CLI. The runtime container build is unaffected (its Dockerfile builds/usr/local/bin/af-stackin its own context).go installthe CLI onto PATH (npm-like front door).build-gokept as a back-compat alias (now builds both).Rebased on the post-#128 main; preserves the
preflighttarget #128 added.Validation
make smoke-cli✅ —bin/af-stack version/help/initreach the CLI.make build-runtime✅ — server builds asbin/af-stack-runtime.go test ./services/cli/...✅ ·go vet ./services/cli/...✅🤖 Generated with Claude Code