Skip to content

goforge new ​

Scaffolds a new GoForge application from github.com/mmycin/goforge-template.

Syntax ​

bash
goforge new [project-name] [module-path]

Modes ​

  1. Interactive Wizard (0 args): goforge new launches a 4-step huh TUI wizard prompting for:
    • Project Name
    • Go Module Path (validated by ^[a-zA-Z0-9._\-]+(/[a-zA-Z0-9._\-]+)+$)
    • Multi-select Databases (sqlite, mysql, postgresql, sqlserver)
    • Confirm Git initialization
  2. Non-Interactive (2 args): goforge new myapp github.com/acme/myapp skips the wizard, defaults to sqlite only, and initializes Git if git is on PATH. (Passing only 1 argument returns an error.)

What It Does ​

  1. Clones https://github.com/mmycin/goforge-template (--branch main) into <project-name>/ and removes .git/.
  2. Replaces all occurrences of "github.com/mmycin/goforge" with <module-path>.
  3. Deletes unselected database drivers from core/database/drivers/.
  4. Runs go mod tidy.
  5. Runs git init, git add ., git commit -m "chore: initial commit from GoForge" (if selected).

Released under the Apache-2.0 License.