Skip to content

feat: scaffold command for new product CLIs#32

Merged
vks-team merged 1 commit into
mainfrom
feat/scaffold-new-product
Jul 7, 2026
Merged

feat: scaffold command for new product CLIs#32
vks-team merged 1 commit into
mainfrom
feat/scaffold-new-product

Conversation

@vks-team

@vks-team vks-team commented Jul 6, 2026

Copy link
Copy Markdown
Contributor

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 name

Generates:

  • go/cmd/<product>/ — parent command (self-registers via cli.RegisterService), an example list-examples command using the shared cli.NewClient/cli.Output helpers, createClient/outputResult wrappers, a starter test, and a product CLAUDE.md with a setup checklist + conventions reminder.
  • docs/commands/<product>/ — index + starter command doc.
  • Wires the blank import into go/cmd/register.go and appends .github/CODEOWNERS lines.

CI (build/test) picks up the new package automatically — zero extra config.

Verified

Ran ./scripts/new-product vdemo on a throwaway product: go build clean, grn vdemo --help and grn vdemo list-examples --help work, 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:

Docs-and-tooling only; no change to the shipped grn binary behavior.

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).
@vks-team vks-team merged commit 9e1b4cb into main Jul 7, 2026
4 checks passed
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