
Golang Spf13 Viper
Layered configuration library with fixed precedence, env binding, struct unmarshaling, and hot reload for Go.
- skills.sh installs
- 38.7K
- GitHub stars
- 3.9K
- last updated
- Aug 21, 2026
What it does
- Covers flag, env, file, KV, and default resolution, plus Sub-trees and
viper.New()test isolation - Includes BindPFlag and BindPFlags for flags, SetEnvPrefix with SetEnvKeyReplacer and AutomaticEnv for env, and ReadInConfig with ConfigFileNotFoundError handling
- Enforces mapstructure struct tags and warns that the global viper leaks state between tests
- Designed for Go projects importing
github.com/spf13/viper, alongside cobra or standalone config-file daemons
Install
$ npx -y skills add samber/cc-skills-golang --skill golang-spf13-viper -yInstalls into .agents/skills for every agent it finds here, and .claude/skills for Claude Code.
Files
Persona: You are a Go engineer who treats configuration as a layered system. Flag beats env beats file beats default — and you bind every key so all four layers stay reachable through one API.
Using spf13/viper for layered configuration in Go
Viper resolves configuration values from multiple sources in a fixed precedence order. It has no user-facing surface — it doesn't define commands or flags. Its job is to answer "what is the value of key X right now?" by walking its source layers from highest to lowest priority.
Official Resources:
This skill is not exhaustive — refer to library documentation and code examples for more information:
Details
- Repository
- github.com/samber/cc-skills-golang
- Category
- Go
- First seen
- May 16, 2026
More from samber/cc-skills-golang
All 47- Golang Uber Fx38.4K
- Golang Uber Dig38.4K
- Golang How To38.3K
- Golang Linter26.5K
- Golang Pkg Go Dev13.7K
- Golang Refactoring13.3K
- Golang Gopls12.9K
- Golang Code Style46.6K
- Golang Testing45.9K
- Golang Error Handling45.9K
- Golang Security44.7K
- Golang Design Patterns44.3K
- Golang Performance44.1K
- Golang Concurrency44.1K
- Golang Context43.2K
- Golang Database43K
- Golang Naming43K
- Golang Safety42.7K
- Golang Project Layout42.5K
- Golang Documentation42.4K
- Golang Modernize42.4K
- Golang Lint42.3K
- Golang Data Structures42.3K
- Golang Troubleshooting42K
Similar to Golang Spf13 Viper
More Go
golang-spf13-cobraSkillsamber/cc-skills-golang39K installsGo CLI command-tree library covering RunE hooks, arg validators, flags, completions, and command testing.
golang-cliSkillsamber/cc-skills-golang41.5K installsGo CLI development guide covering Cobra and Viper setup, flags, exit codes, I/O, and signal handling.
golang-cli-cobra-viperSkillbobmatnyc/claude-mpm-skills443 installsCobra and Viper skill for building production-grade Go CLIs with layered configuration and shell completion.
Pare GoMCP serverdave-london141 starsStructured Go build, test, vet, fmt, and mod output as typed JSON diagnostics.
python-configurationSkillwshobson/agents12.2K installsTyped Python configuration via environment variables, using pydantic-settings, with fail-fast validation at startup.
configuration-managementSkillaj-geddes/useful-ai-prompts450 installsMulti-environment configuration guide covering environment variables, secrets, feature flags, and 12-factor practices.