Skip to content

Replace the flag CLI with Cobra verbs - #22

Draft
kylecrawshaw wants to merge 1 commit into
feat/log-configfrom
feat/cobra-cli
Draft

kylecrawshaw wants to merge 1 commit into
feat/log-configfrom
feat/cobra-cli

Conversation

@kylecrawshaw

@kylecrawshaw kylecrawshaw commented Sep 1, 2026 •

Copy link
Copy Markdown
Member

Summary

  • Stacked on feat(log): json/logfmt/text output with request-scoped labels #21 so serve uses logging.New (json/logfmt/text and request-scoped labels) instead of a hard-coded text handler.
  • Replace stdlib flag with Cobra so the binary is a verb tree (serve, healthcheck, validate, version) instead of a default-serve process with mode bits.
  • A missing or mistyped command is help or an error, not a bound listen port. --config is only on commands that load toml; --verbose is serve-only and still forces debug over [log].level.
  • Update the image CMD/HEALTHCHECK, docs, and examples for the breaking invocations.

Test plan

  • go test ./cmd/anteroom/ — CLI contract tests (unknown command, --healthcheck rejected on root, -v rejected on validate)
  • anteroom with no args prints help and does not bind
  • anteroom statt exits 1 with unknown command
  • anteroom serve --config anteroom.toml starts the gate and honors [log] / ANTEROOM_LOG_* from feat(log): json/logfmt/text output with request-scoped labels #21
  • serve --verbose forces debug hit lines regardless of log.level
  • anteroom healthcheck --config … / validate / version behave as documented
  • Image HEALTHCHECK uses anteroom healthcheck --config …; compose/k8s that relied on image CMD pick up serve

…e gate.

A missing or mistyped command is help or an error instead of binding the listen port; healthcheck, validate, and version are first-class, and --verbose is serve-only.

Co-authored-by: Cursor <cursoragent@cursor.com>
@kylecrawshaw
kylecrawshaw changed the base branch from main to feat/log-config September 1, 2026 15:55
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