Skip to content

build(cli): make bin/af-stack the canonical CLI binary - #129

Merged
AbirAbbas merged 1 commit into
mainfrom
feat/cli-first-binary
Jun 29, 2026
Merged

AbirAbbas merged 1 commit into
mainfrom
feat/cli-first-binary

Conversation

@AbirAbbas

Copy link
Copy Markdown
Contributor

What & why

The README's lead command af-stack init errored with unknown command: the Makefile built the runtime server to bin/af-stack, so the CLI source at services/cli/cmd/af-stack was never built. Two main packages both produce a binary named af-stack, and the build wired up the wrong one.

Per the CLI-first direction, resolve the collision in favour of the CLI:

  • build-cli (strict): services/cli/cmd/af-stack → bin/af-stack — 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 (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).

Rebased on the post-#128 main; preserves the preflight target #128 added.

Validation

  • make smoke-cli ✅ — bin/af-stack version / help / init reach the CLI.
  • make build-runtime ✅ — server builds as bin/af-stack-runtime.
  • go test ./services/cli/... ✅ · go vet ./services/cli/... ✅

🤖 Generated with Claude Code

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>
@AbirAbbas
AbirAbbas merged commit 0e471d2 into main Jun 29, 2026
3 of 9 checks passed
@AbirAbbas
AbirAbbas deleted the feat/cli-first-binary branch June 29, 2026 16:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant