Stencil removes the boilerplate from Go CLIs while giving them a consistent, refined terminal presence.
Stencil
A Go library for building polished command-line apps — typed flags, command trees and a console UI with leveled output and live spinner tasks.
persistent := stencil.NewFlagSet()
cfg := persistent.String("config", "c", "path to config file", "app.yaml")
cfg.Env = "APP_CONFIG"
flags := stencil.NewFlagSet()
flags.Int("workers", "w", "worker count", 1).ConfigKey = "server.workers"
app := stencil.NewApp(
stencil.WithName("app"),
stencil.WithRootCommand(&stencil.Command{
Name: "app", PersistentFlags: persistent,
Sub: []*stencil.Command{{Name: "run", Flags: flags, Run: run}},
}),
stencil.WithConfigFile("config", stencil.YAMLLoader),
)- Status
- shipped
- Year
- 2025
- Role
- Author
- Stack
- Go · CLI