feat: scaffold command for new product CLIs#32
Merged
Conversation
Add scripts/new-product + templates/new-product to scaffold a new product command group under go/cmd/<product>/: parent command, an example command, shared createClient/outputResult helpers, a starter test, and a product CLAUDE.md; it also creates docs/commands/<product>/, wires self-registration in go/cmd/register.go, and appends CODEOWNERS lines. The generated package builds, mounts under `grn <product>`, and its test passes out of the box. Document the flow in CONTRIBUTING. This lowers the barrier for other product teams to build their CLI following the established conventions (mirrors the greennode-mcp new_server.py scaffold).
This was referenced Jul 6, 2026
This was referenced Jul 7, 2026
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.
Summary
First step of aligning the CLI dev flow with greennode-mcp's onboarding ergonomics: a one-command scaffold so other product teams can stand up their CLI following the established conventions (mirrors the MCP
new_server.py)../scripts/new-product vdb # lowercase, valid Go package nameGenerates:
go/cmd/<product>/— parent command (self-registers viacli.RegisterService), an examplelist-examplescommand using the sharedcli.NewClient/cli.Outputhelpers,createClient/outputResultwrappers, a starter test, and a productCLAUDE.mdwith a setup checklist + conventions reminder.docs/commands/<product>/— index + starter command doc.go/cmd/register.goand appends.github/CODEOWNERSlines.CI (build/test) picks up the new package automatically — zero extra config.
Verified
Ran
./scripts/new-product vdemoon a throwaway product:go buildclean,grn vdemo --helpandgrn vdemo list-examples --helpwork, generated test passes. Reverted the throwaway so this PR contains only the scaffold (script + templates + CONTRIBUTING note).Context
This is item #1 of the CLI-flow review (aligning with the mcp flow for onboarding other teams). Planned next, as separate PRs:
create-nodegroupvs vserverserver createnaming difference when we get there — needs a quick decision on which style to standardize.)bump-versionDocs-and-tooling only; no change to the shipped
grnbinary behavior.