golang-cli

Community

Build robust Go CLIs with best-practice patterns.

Authorsamber
Version1.0.0
Installs0

System Documentation

What problem does it solve?

Golang CLI projects often struggle with maintainability and consistency across commands, flags, configuration, and testing. This Skill provides a consolidated set of patterns and best practices to help you build production-ready command-line tools in Go using Cobra and Viper, with clear guidance on structure, I/O discipline, versioning, and automation.

Core Features & Use Cases

  • Recommended project layout for Cobra-based CLIs, including cmd/ structure and a minimal main.go that delegates to Execute().
  • Guidance on flag management, config layering with Viper, and environment variable handling.
  • Patterns for version embedding, exit codes, logging, shell completions, and test strategies for CLI commands.

Quick Start

Use this Skill to scaffold and audit a Cobra-based Go CLI by following the recommended layout and integrating Viper, versioning, and testing patterns.

Dependency Matrix

Required Modules

None required

Components

Standard package

💻 Claude Code Installation

Recommended: Let Claude install automatically. Simply copy and paste the text below to Claude Code.

Please help me install this Skill:
Name: golang-cli
Download link: https://github.com/samber/cc-skills-golang/archive/main.zip#golang-cli

Please download this .zip file, extract it, and install it in the .claude/skills/ directory.
View Source Repository

Agent Skills Search Helper

Install a tiny helper to your Agent, search and equip skill from 471,000+ vetted skills library on demand.