feat: implement rocket add handler command#22
Merged
Conversation
Adds the ability to incrementally add new endpoints to an existing generated project without regenerating everything from scratch. - New shared/generate/append.go — Go file appenders (append to end, insert before closing brace, insert before package-level closer) - New builder/hexagonal/add_handler.go — single-endpoint generation: handler, presenter, domain, port service, service impl, router - New builder/add_handler.go — bridge from CLI to hexagonal, reads rocket.yaml for project context - Updated cmd/project/add/handler.go — wired the RunE, replaces the previous commented-out skeleton Usage: cd <project> && rocket add handler \ --openapi spec.yaml --operationid CreateUser
muhfaris
force-pushed
the
feat/add-handler
branch
from
June 25, 2026 10:11
c11aa26 to
2b1beca
Compare
muhfaris
force-pushed
the
feat/add-handler
branch
from
June 25, 2026 10:16
2b1beca to
62467a7
Compare
- Use cmd.Flags() instead of viper.Get() to prevent rocket.yaml config values (like 'openapi') from overriding CLI flags - Use projectDir (absolute path from cwd) as ProjectName so all generated file paths resolve correctly when running from within the project directory - Fix spec copy path to use projectDir
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.
Adds the ability to incrementally add new endpoints to an existing generated project without regenerating everything from scratch.
Usage: cd && rocket add handler
--openapi spec.yaml --operationid CreateUser