ATLAS PROJECTS ARE ONLINE: A COLLECTİON OF HiGH-PERFORMANCE GO CLI TOOLS. ACCESS AT /PROJECTS/ATLAS-PROJECTS.

Explore Atlas

A Go-native build orchestrator, type-safe and dependency-free.

From Fezcode

gobake

Latest Version: 0.2.0

Download
# Installation
go install github.com/fezcode/gobake/cmd/gobake@latest
gobake.Task("build", func(ctx) {
  return ctx.Bake("bin/app")
})
$ gobake build

Why GOBAKE?

A Programmer's Best Friend

Go-Native

Go-Native is Go-native.
Fast and elegant.

Write your build scripts in Go. No new syntax to learn. Benefit from Go's type safety and performance.

Go-Native changed how we build. It's the most natural build tool I've ever experienced.

Fezcode

CREATOR

Zero Dependencies

Zero Dependencies is Go-native.
Fast and elegant.

The build system is just a Go program. It compiles itself on the fly, requiring nothing but the Go toolchain.

Zero Dependencies changed how we build. It's the most natural build tool I've ever experienced.

Samil B.

ARCHITECT

Metadata Management

Metadata Management is Go-native.
Fast and elegant.

Manage versions, tools, and dependencies in a central `recipe.piml` file.

Metadata Management changed how we build. It's the most natural build tool I've ever experienced.

Fezcoddy

DESIGNER

Self-Bootstrapping

Self-Bootstrapping is Go-native.
Fast and elegant.

Just run `gobake`. It handles the rest, ensuring your build environment is always consistent.

Self-Bootstrapping changed how we build. It's the most natural build tool I've ever experienced.

Neural Nexus

KERNEL

DOCUMENTATION

Core Concepts

gobake operates on a simple principle: Your build system should be as robust as your application.

Instead of relying on fragile shell scripts or complex Makefiles, gobake uses:

  1. Engine: The core Go library that manages tasks.
  2. Context: A helper object passed to every task, providing access to the shell, logging, and metadata.
  3. Recipe: The Recipe.go file that ties it all together.

CLI Command Reference

Project Management

  • gobake init: Initialize a new project in the current directory.
  • gobake version: Show the current version of gobake.
  • gobake help: Show the list of available commands and project tasks.
  • gobake template <git-url>: Clone a repository and initialize it.

Dependency & Tool Management

  • gobake add-tool <url>: Adds a tool to the (tools) list in recipe.piml.
  • gobake add-dep <url>: Adds a library dependency to go.mod.

Versioning

  • gobake bump [patch|minor|major]: Increments the project version in recipe.piml.

Metadata (recipe.piml)

The recipe.piml file is the single source of truth for your project.

(name) my-project
(version) 1.2.3
(authors)
    > Ahmed <ahmed@example.com>
(tools)
    > github.com/swaggo/swag/cmd/swag@latest

Task Management

Tasks are defined using bake.Task(name, description, function).

Task Dependencies

You can define tasks that depend on other tasks using bake.TaskWithDeps.

bake.Task("test", "Run tests", func(ctx *gobake.Context) error { ... })
bake.TaskWithDeps("build", "Build app", []string{"test"}, func(ctx *gobake.Context) error { ... })

gobake Examples

1. Cross-Compilation for Multiple Platforms

This recipe builds your application for Windows, Linux, and macOS.

package main

import (
    "fmt"
    "github.com/fezcode/gobake"
)

func main() {
    bake := gobake.NewEngine()
    bake.LoadRecipeInfo("recipe.piml")

    bake.Task("release", "Build for all platforms", func(ctx *gobake.Context) error {
        platforms := []struct {
            OS   string
            Arch string
            Ext  string
        }{
            {"linux", "amd64", ""},
            {"windows", "amd64", ".exe"},
            {"darwin", "arm64", ""},
        }

        for _, p := range platforms {
            output := fmt.Sprintf("dist/%s-%s-%s%s", 
                bake.Info.Name, p.OS, p.Arch, p.Ext)
            
            err := ctx.BakeBinary(p.OS, p.Arch, output, "-ldflags", "-s -w")
            if err != nil {
                return err
            }
        }
        return nil
    })

    bake.Execute()
}

2. Using External Tools

This recipe installs stringer and uses it to generate code before building.

recipe.piml:

(name) my-app
(tools)
    > golang.org/x/tools/cmd/stringer@latest

Recipe.go:

package main

import "github.com/fezcode/gobake"

func main() {
    bake := gobake.NewEngine()
    bake.LoadRecipeInfo("recipe.piml")

    bake.Task("generate", "Generates code", func(ctx *gobake.Context) error {
        // Ensure tools are installed first
        if err := ctx.InstallTools(); err != nil {
            return err
        }
        ctx.Log("Running stringer...")
        return ctx.Run("go", "generate", "./...")
    })

    bake.Task("build", "Builds app", func(ctx *gobake.Context) error {
        if err := ctx.Run("gobake", "generate"); err != nil {
            return err
        }
        return ctx.Run("go", "build", ".")
    })

    bake.Execute()
}

READY TO GOBAKE?

$go install github.com/fezcode/gobake/cmd/gobake@latest
MIT LICENSE
GO-NATIVE