generator

command
v0.1.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 15, 2026 License: MIT Imports: 3 Imported by: 0

README

generator — code scaffolding CLI

import "github.com/downsized-devs/sdk-go/generator" (CLI, not a library)

Stability: Experimental — CLI tool, not a Go library. See STABILITY.md.

Generates boilerplate (entity, repository, usecase, HTTP handler) for new services that follow the Downsized Devs layered template.

Installation

Run directly from the module:

go run github.com/downsized-devs/sdk-go/generator \
    --name MyEntity \
    --path ./services/my-service \
    --api

Or from a local clone:

cd generator
go run main.go -entity_name=$entity_name -file_location=$file_location -api=$api

Flags

Flag Purpose
-entity_name Entity name in CamelCase (e.g. Invoice).
-file_location Output directory — the generic-service path in your project.
-api Comma-separated API actions: create,edit,delete,get,activate. Empty = all.

Layout

generator/
    main.go         # CLI entry point
    helper/         # filename + path helpers
    modifiers/      # AST transforms
    services/       # template orchestration
    templates/      # Go file templates + naming map

Testing

go test ./generator/...

Tests live in helper/, modifiers/, and services/ subpackages.

Contributing

See CONTRIBUTING.md. Template edits require regenerating sample output to verify the result still compiles.

Documentation

The Go Gopher

There is no documentation for this package.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL