Spin aims to stay:
- Fast
- Language-agnostic
- Git-first
- Decentralized
- Dependency-free
task build # compiles to ./bin/spin
task test # runs go test ./... -count=1Task is optional. You can run the commands directly:
go build -o bin/spin .
go test ./... -count=1Run these locally before pushing. CI runs the same checks.
go fmt ./...
go vet ./...
go mod tidy
go test ./... -count=1golangci-lint is available via task lint but is not required for
contributions — go vet catches the critical issues.
- Keep Spin small. Single binary, no plugins, no daemon, no embedded templates.
- Language-agnostic. Templates target any stack. spin only owns the load / prompt / render / hook pipeline.
- Templates are external. No defaults shipped with the binary.
- Read files before editing them. Match existing indentation (tabs), error formats, and comment style.
- Context propagation. Pass
context.Contextthrough long-running or I/O operations. - Add tests for new functionality. Use
go test -count=1locally. - No comments unless explaining why, not what. The code should be self-documenting.
- Error messages are zero-level: no
registry:,spin <cmd>:, or other category prefixes. Errors returned to the user are plain, direct sentences (e.g."spin.toml not found in /path", not"registry: add local: spin.toml not found in /path"). Internal sentinel errors used witherrors.Ismay carry a short prefix for disambiguation.
- Keep changes focused.
- Open an issue before making large architectural changes.
- Update documentation when behavior changes.
| Directory | Purpose |
|---|---|
cmd/ |
Cobra commands and CLI wiring |
internal/template/ |
Template loading, spin.toml parsing, rendering, hooks |
internal/params/ |
Param types and Huh form generation |
internal/registry/ |
Pinned templates (pinned.json) and local registries (registries.json) |
internal/version/ |
Build version injected at compile time |
internal/spec/ |
Template spec detection (local path, git URL, shorthand) |
internal/log/ |
Project-level charmbracelet/log logger |
Tag a version and push. goreleaser builds binaries for linux/amd64, linux/arm64, darwin/amd64, darwin/arm64, windows/amd64, publishes a GitHub release, and opens a PR on the homebrew tap.
git tag v0.2.0
git push origin v0.2.0Apache 2.0. See LICENSE.