golang-cli

golang-cli is a skill for Claude Code from samber/cc-skills-golang. It costs 126 tokens per session (2,338 once invoked), scanned A, original, MIT.

Guidance for building and reviewing command-line programs in Go. A command-line program is a tool operated from a terminal, with support for commands, options, configuration, input and output, signals, and exit statuses.

In plain words
What is it for?
Use it to create or modify Go CLI tools, add commands and flags, configure settings, embed versions, handle signals and exit codes, add shell completion, validate arguments, or write CLI tests.
Why use it?
It helps avoid inconsistent command behavior and common mistakes in flags, configuration, errors, shell use, and automation. It also gives existing Go CLI code a structured review path.

Skill for Claude Code

Written for Claude Code: allowed-tools in frontmatter. Also seen: names the AskUserQuestion tool; mentions Claude Code; mentions Codex.

Part of the cc-skills-golang plugin — 46 skills shipped together

Good fit Use it to create or modify Go CLI tools, add commands and flags, configure settings, embed versions, handle signals and exit codes, add shell completion, validate arguments, or write CLI tests.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/samber/cc-skills-golang/golang-cli
About the project

samber/cc-skills-golang is a collection of reusable agent instructions for Go development, covering areas such as the language, testing, security, and observability. It is for coding agents assisting with production-oriented Golang projects. The catalogue entries are its Go-specific skills, rule, plugin, and instruction.

samber/cc-skills-golang · 3,800 stars · on GitHub · skills.sh

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

Any agent
npx skills add samber/cc-skills-golang --skill golang-cli
Clone the repo
git clone --depth 1 https://github.com/samber/cc-skills-golang

Made for: Claude Code.

Or install cc-skills-golang, the plugin that ships this one along with the rest of its 46 skills.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for golang-cli

README.md
[![agentmods](https://agentmods.dev/badge/skills/samber/cc-skills-golang/golang-cli/github.svg)](https://agentmods.dev/skills/samber/cc-skills-golang/golang-cli)
Your own site
<a href="https://agentmods.dev/skills/samber/cc-skills-golang/golang-cli"><img src="https://agentmods.dev/badge/skills/samber/cc-skills-golang/golang-cli/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for golang-cli

Your own site · 80×15
<a href="https://agentmods.dev/skills/samber/cc-skills-golang/golang-cli"><img src="https://agentmods.dev/badge/skills/samber/cc-skills-golang/golang-cli.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 126 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 2,338 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe. Third-party audits
  • Socket pass 23 Oct 2026
  • Snyk pass 23 Oct 2026
  • NVIDIA SkillSpector pass 7 Sept 2026
How audits are shown
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00126 $0.02338
Opus 5.5 $0.00050 $0.00935
Sonnet 5.5 $0.00025 $0.00468
Haiku 4.5 $0.00013 $0.00234

Measured 2mo ago against content hash da9eef3871a9, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade A, and why

golang-cli scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 2mo ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

Origin

Copies of this mod

2 near-identical copies found in the catalogue:

skills/golang-cli/SKILL.md · 208 lines

How it starts

The opening of the file, as written. The whole thing — 208 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Persona: You are a Go CLI engineer. You build tools that feel native to the Unix shell — composable, scriptable, and predictable under automation.

Modes:

  • Build — creating a new CLI from scratch: follow the project structure, root command setup, flag binding, and version embedding sections sequentially.
  • Extend — adding subcommands, flags, or completions to an existing CLI: read the current command tree first, then apply changes consistent with the existing structure.
  • Review — auditing an existing CLI for correctness: check the Common Mistakes table, verify SilenceUsage/SilenceErrors, flag-to-Viper binding, exit codes, and stdout/stderr discipline.

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.

Quick Reference

Concern Package / Tool
Commands & flags github.com/spf13/cobra
Configuration github.com/spf13/viper
Flag parsing github.com/spf13/pflag (via Cobra)
Colored output github.com/fatih/color
Table output github.com/olekukonko/tablewriter
Interactive prompts github.com/charmbracelet/bubbletea
Version injection go build -ldflags
Distribution goreleaser

Project Structure

Organize CLI commands in cmd/myapp/ with one file per command. Keep main.go minimal — it only calls Execute().

Read the full file on GitHub · 208 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 2mo ago First seen · 208 lines · 126 tokens per session scan A da9eef3871a9

Subscribe to this mod's changes

golang-cli is a skill published in the GitHub repository samber/cc-skills-golang (3,800 stars, last pushed 5d ago), licensed MIT. It adds 126 tokens to every session and 2,338 once invoked, about $0.0005 per session on Opus 5.5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.

Related

golang-cli compared with skills from other repositories

golang-cli next to 6 skills from other repositories
ModTypeStarsLast pushLicenceScanTokensWorks with
golang-clisamber/cc-skills-golangSkill3.8k5d agoMITA126Claude Code
stack-trace-go-probeopensquilla/opensquillaSkill7.1k6d agoApache-2.0A42Claude Code
golang-prormyndharis/antigravity-skillsSkill1.9k23d agoMITA61Claude Code, Codex
site-launch-checklistsamber/cc-skillsSkill2416d agoMITA206Claude Code
copywriting-hookssamber/cc-skillsSkill2416d agoMITA172Claude Code
copywriting-prose-creatorsamber/cc-skillsSkill2416d agoMITA170Claude Code
deep-researchsamber/cc-skillsSkill2416d agoMITA333Claude Code