# golang-cli

> Claude/Codex skill by [@samber](https://omgskills.com/library/samber/index.md) · 3.7k stars · Updated 2026-10-23

Golang CLI application development. Use when building, modifying, or reviewing a Go CLI tool — especially for command structure, flag handling, configuration layering, version embedding, exit codes, I/O patterns, signal handling, shell completion, argument validation, and CLI unit testing. Also triggers when code uses cobra, viper, or urfave/cli. For cobra-specific APIs → See \`samber/cc-skills-golang@golang-spf13-cobra\` skill; for viper configuration layering → See \`samber/cc-skills-golang@golang-spf13-viper\` skill.

Tags: agent, agent-skills, ai, antigravity, claude, claude-code, code, codex, coding, copilot, cursor, gemini, gemini-cli-extension, openclaw, opencode, plugin, skills, skillsmp, vibe-coding

## Install

```sh
git clone https://github.com/samber/cc-skills-golang /tmp/cc-skills-golang && ln -s /tmp/cc-skills-golang/skills/golang-cli ~/.claude/skills/golang-cli
```

## From README

Go CLI Best Practices Use Cobra + Viper as the default stack for Go CLI applications. Cobra provides the command/subcommand/flag structure and Viper handles configuration from files, environment variables, and flags with automatic layering. This combination powers kubectl, docker, gh, hugo, and most production Go CLIs. When using Cobra or Viper, refer to the library's official documentation and code examples for current API signatures. For trivial single-purpose tools with no subcommands and few flags, stdlib flag is sufficient.

## Links

- HTML page: https://omgskills.com/library/samber/cc-skills-golang/golang-cli/
- GitHub: https://github.com/samber/cc-skills-golang
- Author: [@samber](https://omgskills.com/library/samber/index.md)

## More from this repo

- [golang-benchmark](https://omgskills.com/library/samber/cc-skills-golang/golang-benchmark/index.md) — Golang benchmarking, profiling, and performance measurement.
   - [@samber](https://omgskills.com/library/samber/index.md) · 3.7k stars
- [golang-code-style](https://omgskills.com/library/samber/cc-skills-golang/golang-code-style/index.md) — Golang code style conventions — line length and breaking, variable declarations, control flow clarity, when comments...
   - [@samber](https://omgskills.com/library/samber/index.md) · 3.7k stars
- [golang-concurrency](https://omgskills.com/library/samber/cc-skills-golang/golang-concurrency/index.md) — Golang concurrency design — goroutine lifecycle and leak prevention, channels and \`select\`, channel ownership and...
   - [@samber](https://omgskills.com/library/samber/index.md) · 3.7k stars
