golang-cli

Provide a Go CLI blueprint for command structures, flags, and config management.

Updated Aug 23, 2026
One-click install
npx skills add https://github.com/nrmnqdds/gomaluum --skill golang-cli-nrmnqdds
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: golang-cli
Source: https://github.com/nrmnqdds/gomaluum/tree/main/.agents/skills/golang-cli
Command: npx skills add https://github.com/nrmnqdds/gomaluum --skill golang-cli-nrmnqdds

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Streamline Go CLI development by providing a blueprint for command structures, flags, and configuration management.

Core Features & Use Cases

  • Command structure: standardized root and subcommands with predictable wiring.
  • Config & env handling: consistent Viper binding, env prefixes, and config layering.
  • Quality tooling: guidance for testing, build-time version injection, and shell completions.

Quick Start

Create a minimal root command with Cobra and a sample subcommand to bootstrap your Go CLI project.

Frequently Asked Questions about golang-cli

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I build a Go CLI with predictable command structures and flags?

You can build a Go CLI by applying a standardized blueprint for root and subcommands using Cobra, ensuring predictable wiring and consistent flag handling across your project. This approach covers build, extend, and review workflows.

What is the best way to bind environment variables in a Go CLI using Viper?

The best way to bind environment variables in a Go CLI is through consistent Viper binding, applying env prefixes and config layering within a persistent pre-run config block. This ensures environment variables are handled predictably.

Does this Go CLI blueprint support urfave/cli or only Cobra?

This Go CLI blueprint is applicable to projects using either urfave/cli or Cobra. It provides guidance for command structures, config management, and quality tooling across both frameworks without strict dependency locks.

How do I handle logging and exit code conventions in a Go CLI?

You handle logging and exit codes in a Go CLI by following established conventions for outputs and exit codes. The blueprint guides wiring logging mechanisms and standardizing exit codes to ensure predictable command execution.

Can I generate shell completions and inject build-time version info for a Go CLI?

Yes, you can generate shell completion scripts and inject build-time version information into your Go CLI. The blueprint provides specific tooling guidance to integrate shell completions and version metadata seamlessly.

How do I write tests for a Go CLI built with Cobra and Viper?

You write tests for a Go CLI built with Cobra and Viper by following the provided testing workflow guidance. This ensures your command structures, config layering, and flag parsing logic are validated systematically.