Summary
The sourcebridge CLI has no version subcommand or --version flag. Newcomers and operators need a simple way to confirm which binary they're running, especially when debugging which prerelease is deployed.
What needs to happen
- Add a
version subcommand in cli/ that prints:
- Semver version (from a
Version package var or the build's embedded tag)
- Git commit SHA
- Build date
- Go runtime version (
runtime.Version())
- Wire
--version / -v on the root command so sourcebridge --version prints the same info.
- Populate the version string from
-ldflags at build time (see scripts/build-and-deploy.sh for the existing build invocation).
Where to look
cli/root.go — root cobra.Command that owns the subcommands.
cli/ — all subcommands live here. Drop a new version.go alongside serve.go / ask.go.
scripts/build-and-deploy.sh — add -ldflags "-X 'github.com/sourcebridge/sourcebridge/cli.Version=$TAG' -X '...Commit=$SHA'".
Makefile — the build target should gain the same ldflags for local builds.
Acceptance
sourcebridge version prints a multi-line block with version, commit, build date, go runtime.
sourcebridge --version prints the short form (just the version number).
- Unset ldflags (bare
go build ./...) prints dev instead of failing.
Difficulty
Beginner-friendly for Go developers. Self-contained in the CLI layer. No protocol or data-model changes.
Summary
The
sourcebridgeCLI has noversionsubcommand or--versionflag. Newcomers and operators need a simple way to confirm which binary they're running, especially when debugging which prerelease is deployed.What needs to happen
versionsubcommand incli/that prints:Versionpackage var or the build's embedded tag)runtime.Version())--version/-von the root command sosourcebridge --versionprints the same info.-ldflagsat build time (seescripts/build-and-deploy.shfor the existing build invocation).Where to look
cli/root.go— rootcobra.Commandthat owns the subcommands.cli/— all subcommands live here. Drop a newversion.goalongsideserve.go/ask.go.scripts/build-and-deploy.sh— add-ldflags "-X 'github.com/sourcebridge/sourcebridge/cli.Version=$TAG' -X '...Commit=$SHA'".Makefile— thebuildtarget should gain the same ldflags for local builds.Acceptance
sourcebridge versionprints a multi-line block with version, commit, build date, go runtime.sourcebridge --versionprints the short form (just the version number).go build ./...) printsdevinstead of failing.Difficulty
Beginner-friendly for Go developers. Self-contained in the CLI layer. No protocol or data-model changes.