Craft v0.1.0 is now available

The Modern Engine
for Go Developers.

An extremely fast, all-in-one toolkit for Go development. Craft brings your toolchains, package management, and build pipelines together into one seamless workflow.

$ go install github.com/onurartan/craft@latest

Quick Start

From zero to a fully orchestrated Go environment in under 15 seconds. Pure Go, pure speed.

# 1. Install Craft
$ go install github.com/onurartan/craft@latest
# 2. Scaffold a new project (or run `craft init`)
$ craft create my-api
# 3. Start the Hot-Reload engine
$ craft dev

The Ecosystem

Smart Package Manager

Inspired by uv and npm, Craft provides a high-level CLI to effortlessly add, remove, and sync Go modules with beautiful, explicit diff reporting.

$ craft sync
Added 2 packages:
github.com/gofiber/fiber/v2
github.com/joho/godotenv
Updated 1 package:
golang.org/x/crypto

Hot-Reload Engine

Zero-config craft dev command. Features intelligent debouncing, completely isolated temporary builds in your OS /tmp directory, and graceful shutdowns.

Smart Error Parser

Craft intercepts messy Go compiler errors and transforms them into an elegant, highly-readable UI using pterm, complete with actionable hints that act as your pair programmer.

✖ Build Failed [linux/amd64]
cmd/server/main.go:42
undefined: fiber.New()
Hint: Run 'craft build' to auto-install or 'go mod tidy'.

Inline Scripting

Turn Go into a scripting language. Execute raw .go files instantly with isolated, automatic dependency resolution in /tmp. Zero project setup required.

#!/usr/bin/env craft run --script
package main
import "fmt"
func main() {
fmt.Println("Go as a script!")
}

Interactive Toolchain Manager

Craft acts as an nvm-like version manager with a beautiful Terminal UI. Browse remote go.dev releases and seamlessly auto-install isolated toolchains into ~/.craft.

? Which toolchain would you like to install?
go1.22.1
go1.22.0
go1.21.8
↑↓ Navigate Enter Install Selected Q Quit

Asset Minifier

Natively compress HTML, CSS, JS, and JSON during the build phase. No Node.js, Webpack, or external dependencies required.

Declarative Infrastructure

Click any block in the configuration file below to explore how Craft replaces complex bash scripts with a single, deterministic YAML source of truth.

.craft.yaml
# Metadata & Core
name: "craft-api"
entry_point: "cmd/api"
auto_install: true
# Dynamic Versioning
version: "in_go:main.AppVersion"
version_pkg: "main.Version"
# Optimization Flags
strip_debug: true
trimpath: true
cgo_enabled: false
# Cross-Platform Targets
build_all: false
platforms:
- "linux/amd64"
- "windows/amd64"
# Asset Minifier
minify:
enabled: true
dirs: ["web", "public"]
# Hot-Reload Config
dev:
watch:
delay_ms: 500
include_exts: ["go", "html"]
# Custom Task Runner
commands:
envs:
PORT: "8080"
db-migrate: "{APP_BIN_PATH:NOBUILD} --migrate"
# Workflow Profiles
profiles:
release:
output_dir: "dist/v1"
strip_debug: true

Core Metadata

Define the absolute bare minimum required to orchestrate your Go builds. Set your entry point, base name, and toggle the powerful Package Manager automation.

Auto-Install Magic: When auto_install: true, Craft acts as an intelligent package manager. It automatically runs go get for any missing dependencies the moment you hit save, preventing "missing module" compiler errors and keeping you in the flow.

Dynamic Versioning Engine

Stop hardcoding versions. Craft features a native AST (Abstract Syntax Tree) parser that safely extracts values directly from your Go source code or JSON/YAML files without compiling.

1. AST Extraction (`in_go:`)

Reads the target Go file safely extracting the constant value.

"in_go:main.AppVersion"

2. Struct Extraction (`file:`)

Parses JSON or YAML files to extract specific nested keys.

"file:package.json|version"

3. LDFLAGS Injection

The extracted value is automatically injected into your binary at compile time via -ldflags "-X =...".

Optimization & Security Flags

Control the Go compiler's lowest-level flags with simple booleans. Craft handles the complex arguments automatically.

strip_debug:

Removes DWARF symbol tables (`-s -w`), dramatically reducing the final binary size for production deployments.

trimpath:

Removes absolute file system paths from the compiled binary, ensuring deterministic builds and protecting your host machine's directory privacy.

cgo_enabled:

Toggle CGO. Setting this to false guarantees a pure Go static binary without external C library dependencies.

Native Cross-Compilation

Craft completely eliminates the need to write massive bash loops. Simply define your target architectures in an array and Craft compiles them concurrently.

Setting build_all: true tells Craft to bypass the array and instantly compile for a massive matrix covering Windows, Linux, and macOS (AMD64 and ARM64 architectures) all at once.

Built-in Asset Minifier

Craft is shipped with the industry-leading tdewolff/minify engine. It compresses your HTML, CSS, JS, SVG, and JSON assets natively during the build phase.

No Node.js Required: You no longer need to pull in Webpack, esbuild, or heavy Node.js dependencies just to minify some CSS. Point Craft to your dirs and it will output optimized files into a _min folder.

Zero-Config Hot Reload

The Hot-Reload engine watches your source code and restarts your application instantly upon changes. It features a highly intelligent debouncer to prevent rapid sequential rebuilds (e.g., when clicking "Save All").

Craft compiles the temporary binary directly into your OS's /tmp directory, ensuring your workspace remains clean of intermediate compilation artifacts.

The Task Runner (Commands)

Craft includes a powerful Task Runner engine. Define custom macros and execute them natively as CLI subcommands to orchestrate your entire development lifecycle gracefully.

1. Custom Envs

Define envs globally under the commands block. These environment variables are safely injected during any macro execution automatically.

2. The Auto-Build Macro (`{APP_BIN_PATH}`)

Use smart macros like {APP_BIN_PATH} inside your commands. Craft will automatically compile your binary in the background and insert the absolute path to the executable before running the command.

Check out the Documentation Portal for a deep dive into command composition ($) and OS-specific execution rules.

Build Workflow Profiles

Maintain a clean configuration file by organizing specific environments into distinct profiles. Override output paths, platforms, and flags on the fly.

$ craft build -P release

Running this command merges the release profile over the base configuration, overriding the output_dir and aggressively stripping debug symbols.

Ready to orchestrate your Go workflow?

Join the modern era of Go development. Zero configuration required to start, infinitely customizable when you need it.