gobake is a Go-native build orchestrator. It replaces Makefiles and shell scripts with a single, type-safe Recipe.go file.
Inspired by nob.h, gobake allows you to write your build logic in Go, which is then compiled and executed on the fly. It also features a recipe.piml file for managing project metadata and dependencies.
- Go-Native: Write your build scripts in Go. No new syntax to learn.
- Zero Dependencies: The build system is just a Go program.
- Metadata Management: Centralized project info (Version, Authors, Tools) in
recipe.piml. - Task Dependencies: Define ordered execution requirements for tasks.
- Auto-Versioning: Built-in semantic versioning bumping (
gobake bump patch). - Cross-Compilation: Simple helpers for baking binaries for different platforms.
- Self-Bootstrapping: Just run
gobake. It handles the rest.
go install github.com/fezcode/gobake/cmd/gobake@latest-
Initialize a new project:
mkdir my-project cd my-project gobake initThis creates a
recipe.pimland aRecipe.go. -
Run a task:
gobake build
gobake init: Scaffolds a newRecipe.goandrecipe.piml.gobake version: Displays the current version of gobake.gobake help: Displays the list of commands and available tasks.gobake bump [patch|minor|major]: Increments the version inrecipe.piml.gobake template <git-url>: Clones a repo and initializes it with gobake.gobake add-tool <url>: Adds a dev tool torecipe.piml.gobake remove-tool <url>: Removes a dev tool fromrecipe.piml.gobake add-dep <url>: Adds a library dependency (go get).gobake remove-dep <url>: Removes a library dependency.gobake <task>: Runs a defined task (e.g.,build,test,deploy).
This file holds your project's metadata.
(name) my-app
(version) 1.0.0
(description) A cool Go application
(license) MIT
(tools)
> github.com/golangci/golangci-lint/cmd/golangci-lint@latest
This is where you define your build logic.
package main
import (
"github.com/fezcode/gobake"
)
func main() {
bake := gobake.NewEngine()
bake.LoadRecipeInfo("recipe.piml")
bake.Task("build", "Builds the binary", func(ctx *gobake.Context) error {
ctx.Log("Building v%s...", bake.Info.Version)
return ctx.BakeBinary("linux", "amd64", "bin/app")
})
bake.TaskWithDeps("deploy", "Deploy after build", []string{"build"}, func(ctx *gobake.Context) error {
ctx.Log("Deploying...")
return nil
})
bake.Execute()
}See the docs/ directory for detailed guides.
