golang-cli Skill for Claude Code: Build Go CLI Tools with Cobra and Viper
Makes Claude build, extend and review Go command-line tools with Cobra and Viper, following Unix conventions.
- Installs
- 40.4K
- on skills.sh
- Stars
- 3.7K
- on GitHub
- Files
- 14
- besides SKILL.md
- Updated
- Nov 2026
- last repo commit
golang-cli sets Cobra plus Viper as the default stack for Go command-line apps and tells Claude how to structure one. It covers the project layout, root command, flags, argument validation, config layering, version embedding, exit codes, signal handling, shell completions and CLI tests.
It runs in three modes, Build, Extend and Review. It bundles 13 example files under assets/examples that Claude points to instead of pasting long code.
Good for
- Go developers building a new command-line tool
- Maintainers adding subcommands, flags or shell completions to an existing CLI
- Reviewers auditing a CLI for exit codes, stdout and stderr use and flag handling
Install golang-cli
Claude Code
- 1
Copy this prompt.
Install the golang-cli skill in Claude Code. Run this command: /plugin marketplace add samber/cc /plugin install cc-skills-golang@samber Then check that it loaded and tell me how to use it.
- 2
Paste it into Claude Code. It shows the change and asks before running it.
Pick one route, not several. The README says the skills cross-reference each other and a subset gives a partial and potentially inconsistent view, so the plugin or the whole-set CLI command is the better choice. The plugin installs the repo's 46 skill folders; its manifest declares no hooks, commands or MCP servers. Claude Code names plugin skills /plugin-name:skill-name, so after the plugin install the full name is /cc-skills-golang:golang-cli. The samber/cc marketplace lists seven plugins; the second command installs only cc-skills-golang.
From the project README. Source.
What's in the skill
When it loads
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.
Sections in SKILL.md
- Quick Reference
- Project Structure
- Root Command Setup
- Subcommands
- Flags
- Persistent vs Local
- Required Flags
- Flag Validation with RegisterFlagCompletionFunc
- Always Bind Flags to Viper
- Argument Validation
- Configuration with Viper
- Example Config File (.myapp.yaml)
- Version and Build Info
- Exit Codes
- I/O Patterns
- Signal Handling
Key facts
- Installs on skills.sh
- 40,359 as of 2026-11-02
- Last repo commit
- 2026-11-01
What it includes
Create a new CLI from scratch, section by section
Follow project structure, root command setup, flag binding and version embedding in order.
Write ·
Build modeAdd subcommands, flags or completions to an existing CLI
Claude reads the current command tree first, then adds changes that match it.
Write ·
Extend modeAudit a CLI against the common-mistakes table
Checks SilenceUsage and SilenceErrors, flag-to-Viper binding, exit codes and stdout and stderr discipline.
Read ·
Review modeFlags beat env vars, which beat config files, which beat defaults
Viper resolves values in that order, and the skill says to bind every flag to Viper.
Read ·
Config layering0, 1, 2, 64-78, 126, 127 and 128+N
A table of Unix exit code conventions plus an example that maps errors to codes.
Read ·
Exit codessignal.NotifyContext and Cobra shell completions
Graceful shutdown through context cancellation, and generated completions for bash, zsh, fish and PowerShell.
Read ·
Signals and completions13 example files: main.go, root.go, flags.go, config.go and more
Example Go files for each topic, including a test file. SKILL.md links to them rather than inlining the code.
Read ·
assets/examples
From the official docs
Permissions
Low risk
Claude can edit your Go files and run go and git commands while this skill is active. Work on a branch and read the diff before you commit.
What it can do
- Read your data
- Create and change things
- Delete things
- Read-only mode
Watch out for
It edits files and runs commands in your project
The frontmatter lists Edit, Write and these shell commands: go:*, golangci-lint:*, git:*. Work on a branch and read the diff before you commit. github.com
The recommended plugin route installs the whole repo
The plugin route and the --all skills CLI command add all 46 skill folders in the repo, not only this one. The plugin manifest (.claude-plugin/plugin.json, version 2.0.1) declares a name, description, author, license and keywords, and lists no hooks, commands or MCP servers. The skills CLI docs say --all installs every skill into every agent it supports without prompts. github.com
Technical details
| Sign-in and keys | SKILL.md names no account or API key. |
|---|---|
| Scopes |
|
Questions
What does golang-cli do?
It makes Claude build, extend or review Go command-line tools using Cobra and Viper. It covers command structure, flags, configuration layering, version embedding, exit codes, I/O, signals, completions and tests.
How do I install golang-cli?
Install the whole golang set, not only this skill. The README calls the skills atomic, cross-referencing units and says a partial install gives a potentially inconsistent view. The install box lists the Claude Code plugin (/plugin marketplace add samber/cc, then /plugin install cc-skills-golang@samber), the skills CLI for the whole set or for this skill alone, and the README's Codex, Gemini CLI, Cursor and OpenCode routes. The README documents no Claude app route, so none is listed.
Do I need the other golang skills with golang-cli?
Installing the set is the safer choice. SKILL.md hands neighboring topics to other skills: golang-spf13-cobra, golang-spf13-viper, golang-project-layout, golang-dependency-injection, golang-testing, golang-design-patterns. The README says to install the general-purpose skills together, and the whole-set install does that.
What does golang-cli need on my machine?
The frontmatter names these programs: go. SKILL.md names no API key or account.
Is golang-cli safe?
It is instruction text plus example Go files under assets/examples. When you use it, Claude can edit files and run go, golangci-lint and git commands in your project, as its frontmatter allows. Work on a branch, read the diff and approve commands you do not recognize.
golang-cli vs the Cobra and Viper skills?
golang-cli is the overall design guide for a CLI. Its description sends Cobra-specific APIs to golang-spf13-cobra and Viper configuration layering to golang-spf13-viper.
Does golang-cli work in Codex, Cursor or the Claude app?
The SKILL.md compatibility field says it is designed for Claude Code, Codex or a similar harness, and the README says the skills are built for Claude Code, Codex, Gemini, Copilot, Antigravity and Cursor. The install box covers Claude Code, Codex, Gemini CLI, Cursor, OpenCode and the skills CLI. The README documents no Claude app route.
Information
updated Nov 2, 2026
- Repository
- samber/cc-skills-golang
- Folder
skills/golang-cli
Sources
Docs, issue trackers and discussions this page is built from.
Show all 6Hide
- cc-skills-golang README · github.com
- skills CLI commands · github.com
- cc-skills-golang plugin.json · github.com
- samber/cc marketplace.json · github.com
- Claude Code skills · code.claude.com
- golang-cli SKILL.md · github.com