$ account magefile
Mage is a build tool written in Go that replaces Makefiles with plain Go functions. Users define targets as exported functions in Go source files tagged with `//go:build mage`, and Mage compiles them into a standalone CLI binary. The architecture is a library-plus-CLI: the `mage` package handles parsing, compilation, and execution; the `mg` package provides dependency injection (`Deps`, `SerialDeps`, `CtxDeps`) and namespace grouping; the `sh` package offers shell command execution with environment expansion; the `parse` package uses Go's AST to extract targets and imports; and the `target` package implements file-based dependency checking. The tool supports zero-install via `go run`, static compilation, shell completion, and importing targets from other packages. It is a mature, well-tested project with no external dependencies beyond the Go standard library, making it highly portable and maintainable.