You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+20-7Lines changed: 20 additions & 7 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -68,14 +68,27 @@ const (
68
68
)
69
69
70
70
typeFormstruct {
71
-
Namestring
72
-
ServerTypeFlagServerTypeFlag
73
-
DatabaseFlagbool
74
-
MakefileFlagbool
71
+
Namestring
72
+
ServerTypeFlagServerTypeFlag
73
+
DatabaseFlagbool
74
+
MakefileFlagbool
75
+
DockerFlagbool
75
76
}
76
77
```
77
78
78
-
If all required flags are provided (including `--database`), the TUI is skipped and the server is generated immediately.
79
+
For non-interactive use (without opening the TUI options), explicitly provide each boolean option, including false values:
80
+
81
+
```bash
82
+
goforge generate \
83
+
--path rest-server \
84
+
--name my-server \
85
+
--server rest \
86
+
--database=false \
87
+
--makefile=true \
88
+
--docker=false
89
+
```
90
+
91
+
Docker generation requires database generation. If a generated file already exists, `goforge` preserves it and returns an error; pass `--force` to explicitly replace generated files.
79
92
80
93
For example, running with all required flags will produce:
81
94

@@ -85,10 +98,10 @@ Here is an example where you can trigger the TUI:\
85
98
86
99
### Roadmap
87
100
88
-
-[X] Allow different server type boilerplates
101
+
-[x] Allow different server type boilerplates
89
102
-[x] REST (`go-chi`)
90
103
-[x] gRPC (`grpc-go`)
91
-
-[X] GraphQL (`gqlgen`)
104
+
-[x] GraphQL (`gqlgen`)
92
105
-[x] Add Makefile support flag
93
106
-[x] Add SQLc/database support flag
94
107
-[x] Potentially add a docker-compose file to spin up a PostgreSQL instance
generateCmd.Flags().BoolVarP(&cfg.Force, "force", "f", false, "Overwrite generated files that already exist")
42
31
43
32
// flags for form fields
44
33
generateCmd.Flags().StringVarP(&cfg.Form.Name, "name", "n", "", "The name for the go.mod module")
@@ -48,16 +37,13 @@ func init() {
48
37
generateCmd.Flags().BoolVarP(&cfg.Form.DockerFlag, "docker", "D", false, "Generate Docker Compose (for DB) and .env file (if flag is set, set to true)")
0 commit comments