charm-fang

Wrap Cobra-based Go CLIs with styled help, errors, and versioning.

12|2|Updated Mar 17, 2026
One-click install
npx skills add https://github.com/alxxpersonal/forge --skill charm-fang
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: charm-fang
Source: https://github.com/alxxpersonal/forge/tree/main/skills/charm-fang
Command: npx skills add https://github.com/alxxpersonal/forge --skill charm-fang

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Fang wraps Cobra to provide styled help, error output, and automatic versioning for Go CLIs.

Core Features & Use Cases

  • Styled help and error output for Cobra-based CLIs.
  • Auto versioning from build info or provided strings, hidden manpage generation, and shell completion support.
  • Use case: You are building a Go CLI with Cobra and want a polished user experience with consistent output and optional manpage/docs.

Quick Start

Create a minimal Cobra app and run fang.Execute with a version to enable styled help and automatic versioning.

Frequently Asked Questions about charm-fang

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

FAQPage Schema
How do I add styled help and auto versioning to a Cobra CLI in Go?

Styled help and auto versioning are added to a Go Cobra CLI by wrapping the root command with fang.Execute and passing options like WithVersion or WithCommit. This automatically injects styled error output and consistent theming into the application.

Can I disable shell completions and manpage generation for my Go CLI?

Shell completions and manpage generation can be disabled in a Go CLI by passing the WithoutCompletions and WithoutManpage options to the fang wrapper. These subcommands are enabled by default but can be explicitly excluded from the final build.

What is the best way to customize Cobra error output and help themes?

Customizing Cobra error output and help themes is achieved by passing a custom color scheme function to the fang wrapper. This pluggable theming capability allows developers to tailor styled help and enhanced errors to match their application's design.

Does fang work with Cobra to handle signals in command line applications?

Fang works with Cobra to handle signals in command line applications by using the WithNotifySignal option. This integrates signal management directly into the Cobra wrapper alongside styled help and automatic versioning features.

How do I configure automatic versioning from build info in a Go CLI?

Automatic versioning from build info is configured in a Go CLI by wrapping the Cobra application with fang and using the WithVersion option. To explicitly exclude version output, you pass the WithoutVersion option to the wrapper function.