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.
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.
Inline Scripting
Turn Go into a scripting language. Execute raw .go files instantly with isolated, automatic dependency resolution in /tmp. Zero project setup required.
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.
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.
entry_point: "cmd/api"
auto_install: true
version_pkg: "main.Version"
trimpath: true
cgo_enabled: false
platforms:
- "linux/amd64"
- "windows/amd64"
enabled: true
dirs: ["web", "public"]
watch:
delay_ms: 500
include_exts: ["go", "html"]
envs:
PORT: "8080"
db-migrate: "{APP_BIN_PATH:NOBUILD} --migrate"
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: 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.
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.
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").
/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.